### Question:
JaxRsResponse extends RestfulResponse<JaxRsRequest> { @Override public Object sendAttachmentResponse(IBaseBinary bin, int statusCode, String contentType) { ResponseBuilder response = buildResponse(statusCode); if (bin.getContent() != null && bin.getContent().length > 0) { response.header(Constants.HEADER_CONTENT_TYPE, contentType).entity(bin.getContent()); } return response.build(); } 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 testSendAttachmentResponse() throws IOException { boolean respondGzip = true; IBaseBinary binary = new Binary(); String contentType = "foo"; byte[] content = new byte[] { 1, 2, 3, 4 }; binary.setContentType(contentType); binary.setContent(content); boolean theAddContentLocationHeader = false; Response result = (Response) RestfulServerUtils.streamResponseAsResource(request.getServer(), binary, theSummaryMode, 200, theAddContentLocationHeader, respondGzip, this.request); assertEquals(200, result.getStatus()); assertEquals(contentType, result.getHeaderString(Constants.HEADER_CONTENT_TYPE)); assertEquals(content, result.getEntity()); }