### Question:
ResourceDetailsJaxrsService { protected Response toResponse(FileResourceData data, String name, String fileType) { if(!data.hasData()){ return Response.noContent().build(); } Response.ResponseBuilder builder = Response.ok(data.getDataStream()); builder.header("Pragma", "").header("Cache-Control", "no-store"); if (ContentResource.TYPE_XLS.equals(fileType) || ContentResource.TYPE_XLSX.equals(fileType) || ContentResource.TYPE_DOCX.equals(fileType) || ContentResource.TYPE_PPTX.equals(fileType)) { builder.header("Content-Disposition", "inline"); } String contentType = contentTypeMapping.get(fileType); if (contentType == null) { if (name.contains(".") && !name.endsWith(".")) { contentType = contentTypeMapping.get(name.substring(name.lastIndexOf(".") + 1)); } } if (contentType == null && ContentResource.TYPE_IMAGE.equals(fileType)) { try { Iterator<ImageReader> readers = ImageIO.getImageReaders(ImageIO.createImageInputStream(data.getDataStream())); String format = null; while (readers.hasNext()) { format = readers.next().getFormatName(); } contentType = "image/" + (format == null ? "*" : format.toLowerCase()); } catch (Exception e) { } } return builder.type(contentType == null ? MediaType.APPLICATION_OCTET_STREAM : contentType).build(); }  Response getResourceDetails(String uri, String accept, Boolean _expanded, Set<String> expandTypes, List<String> includes,
                                       Map<String, String[]> additionalProperties); Response deleteResource(String uri); ClientResource createResourceViaForm(FormDataMultiPart multiPart, String parentUri, Boolean createFolders,
            String accept, boolean dryRun, Map<String, String[]> additionalProperties); Response defaultPostHandler(InputStream stream, String uri, String sourceUri, String disposition,
            String description, String rawMimeType, String accept, Boolean createFolders, Boolean overwrite,
            String renameTo, boolean dryRun, Map<String, String[]> additionalProperties); Response updateResourceViaForm(FormDataMultiPart multiPart, String uri, boolean createFolders, String accept,
            boolean dryRun, Map<String, String[]> additionalProperties); Response updateFileViaForm(InputStream stream, String uri, String label, String description, String type, boolean dryRun); Response defaultPutHandler(InputStream stream, String uri, String sourceUri, String disposition,
            String description, String rawMimeType, String accept, Boolean createFolders, Boolean overwrite,
            String renameTo, boolean dryRun, Map<String, String[]> additionalProperties); ClientResource createResource(ClientResource resourceLookup, String parentUri, boolean createFolders, boolean dryRun, String accept); ClientResource createResource(ClientResource resourceLookup, String parentUri, boolean createFolders,
            boolean dryRun, String accept, Map<String, String[]> additionalProperties); ClientResource createResource(ClientResource resourceLookup, String parentUri, boolean createFolders,
            Map<String, InputStream> attachments, boolean dryRun, String accept, Map<String, String[]> additionalProperties); ClientResource updateResource(ClientResource resourceLookup, String uri,
            Map<String, InputStream> attachments, boolean dryRun, Map<String, String[]> additionalProperties); static final String PATH_PARAM_URI; }### Answer:
@Test public void toResponse_hasNoData(){ final Response response = service.toResponse(new FileResourceData((byte[]) null), null, null); assertEquals(response.getStatus(), 204); }