### Question:
BaseRestResource { protected Response buildResponse(MIMETypedStream result) throws Exception { ResponseBuilder builder = null; switch (result.getStatusCode()) { case HttpStatus.SC_MOVED_TEMPORARILY: URI location = URI.create(IOUtils.toString(result.getStream())); return Response.temporaryRedirect(location).build(); case HttpStatus.SC_NOT_MODIFIED: builder = Response.notModified(); break; default: builder = Response.status(result.getStatusCode()); if (result.getSize() != -1L){ builder.header(HttpHeaders.CONTENT_LENGTH,result.getSize()); } if (!result.getMIMEType().isEmpty()){ builder.type(result.getMIMEType()); } InputStream content = result.getStream(); if (content != null) { builder.entity(result.getStream()); } } if (result.header != null) { for (Property header : result.header) { if (header.name != null && !(header.name.equalsIgnoreCase(HttpHeaders.TRANSFER_ENCODING)) && !(header.name.equalsIgnoreCase(HttpHeaders.CONTENT_LENGTH)) && !(header.name.equalsIgnoreCase(HttpHeaders.CONTENT_TYPE))) { builder.header(header.name, header.value); } } } return builder.build(); } BaseRestResource(Server server);  static final String VALID_PID_PART; static final String FORM; static final String HTML; static final String XML; static final String ZIP; static final MediaType TEXT_HTML; static final MediaType TEXT_XML; static final MediaType APP_ZIP; }### Answer:
@Test public void testBuildResponseStatus() throws Exception { MIMETypedStream input = new MIMETypedStream("lol/wut", NullInputStream.NULL_STREAM, null); Response output = null; input.setStatusCode(HttpStatus.SC_OK); output = test.buildResponse(input); assertEquals(HttpStatus.SC_OK, output.getStatus()); input.setStatusCode(HttpStatus.SC_NOT_MODIFIED); output = test.buildResponse(input); assertEquals(HttpStatus.SC_NOT_MODIFIED, output.getStatus()); input.setStatusCode(HttpStatus.SC_PARTIAL_CONTENT); output = test.buildResponse(input); assertEquals(HttpStatus.SC_PARTIAL_CONTENT, output.getStatus()); input.setStatusCode(HttpStatus.SC_MOVED_TEMPORARILY); output = test.buildResponse(input); assertEquals(HttpStatus.SC_TEMPORARY_REDIRECT, output.getStatus()); }