### Question:
InvokeResultJsonUnmarshaller implements
        Unmarshaller<InvokeResult, JsonUnmarshallerContext> { @Override public InvokeResult unmarshall(JsonUnmarshallerContext context) throws Exception { InvokeResult invokeResult = new InvokeResult(); if (context.getHeader("X-Amz-Function-Error") != null) invokeResult.setFunctionError(context.getHeader("X-Amz-Function-Error")); if (context.getHeader("X-Amz-Log-Result") != null) invokeResult.setLogResult(context.getHeader("X-Amz-Log-Result")); invokeResult.setStatusCode(context.getHttpResponse().getStatusCode()); ByteBuffer payload = EMPTY_BYTEBUFFER; InputStream content = context.getHttpResponse().getContent(); if (content != null) { payload = ByteBuffer.wrap(IOUtils.toByteArray(content)); } invokeResult.setPayload(payload); return invokeResult; }  @Override InvokeResult unmarshall(JsonUnmarshallerContext context); static InvokeResultJsonUnmarshaller getInstance();  }### Answer:
@Test public void testUnmarshall() throws Exception { int statusCode = 299; String error = "error"; String log = "a very long log"; String content = "some content"; HttpResponse response = HttpResponse.builder() .statusCode(statusCode) .statusCode(statusCode) .header("X-Amz-Function-Error", error) .header("X-Amz-Log-Result", log) .content(new ByteArrayInputStream(content.getBytes(StringUtils.UTF8))) .build(); JsonUnmarshallerContext context = new JsonUnmarshallerContext(null, response); InvokeResultJsonUnmarshaller unmarshaller = InvokeResultJsonUnmarshaller.getInstance(); InvokeResult result = unmarshaller.unmarshall(context); assertTrue("status code", statusCode == result.getStatusCode()); assertEquals("error", error, result.getFunctionError()); assertEquals("log", log, result.getLogResult()); ByteBuffer payload = result.getPayload(); assertArrayEquals("same payload", content.getBytes(StringUtils.UTF8), payload.array()); }