### Question:
JaxRsResponse extends RestfulResponse<JaxRsRequest> { @Override public Response returnResponse(ParseAction<?> outcome, int operationStatus, boolean allowPrefer, MethodOutcome response, String resourceName) throws IOException { StringWriter writer = new StringWriter(); if (outcome != null) { FhirContext fhirContext = getRequestDetails().getServer().getFhirContext(); IParser parser = RestfulServerUtils.getNewParser(fhirContext, fhirContext.getVersion().getVersion(), getRequestDetails()); outcome.execute(parser, writer); } return sendWriterResponse(operationStatus, getParserType(), null, writer); } JaxRsResponse(JaxRsRequest request); @Override Writer getResponseWriter(int theStatusCode, String theStatusMessage, String theContentType, String theCharset, boolean theRespondGzip); @Override Response sendWriterResponse(int theStatus, String theContentType, String theCharset, Writer theWriter); @Override Object sendAttachmentResponse(IBaseBinary bin, int statusCode, String contentType); @Override Response returnResponse(ParseAction<?> outcome, int operationStatus, boolean allowPrefer,
			MethodOutcome response, String resourceName);  }### Answer:
@Test public void testReturnResponse() throws IOException { boolean addContentLocationHeader = true; boolean respondGzip = true; Response result = (Response) RestfulServerUtils.streamResponseAsResource(request.getServer(), createPatient(), theSummaryMode, 200, addContentLocationHeader, respondGzip, this.request); assertEquals(200, result.getStatus()); assertEquals("application/json+fhir; charset=UTF-8", result.getHeaderString(Constants.HEADER_CONTENT_TYPE)); System.out.println(result.getEntity().toString()); assertTrue(result.getEntity().toString().contains("resourceType\": \"Patient")); assertTrue(result.getEntity().toString().contains("15")); }