### Question:
CpkUtils { public static Response.Status getEquivalentStatusFromHttpServletResponse( HttpServletResponse response ) { if ( response != null ) { Response.Status equivalentStatus = Response.Status.fromStatusCode( response.getStatus() ); if ( equivalentStatus != null ) { return equivalentStatus; } } return Response.Status.OK; }  static void setResponseHeaders( HttpServletResponse response, final String mimeType ); static void setResponseHeaders( HttpServletResponse response, final String mimeType,
                                         final String attachmentName ); static void setResponseHeaders( HttpServletResponse response, final String mimeType,
                                         final String attachmentName,
                                         long attachmentSize ); static void setResponseHeaders( HttpServletResponse response, final String mimeType, final int cacheDuration,
                                         final String attachmentName, long attachmentSize ); static void redirect( HttpServletResponse response, String url ); static Response redirect( String url ); static Map<String, Object> getRequestParameters(
    Map<String, Map<String, Object>> bloatedMap ); static Map<String, Object> getPathParameters( Map<String, Map<String, Object>> bloatedMa ); static OutputStream getResponseOutputStream( HttpServletResponse response ); static void send( HttpServletResponse response, InputStream fileInputStream, String mimeTypes, String fileName, boolean sendAsAttachment ); static void send( HttpServletResponse response, InputStream fileInputStream, String mimeTypes,
                     String fileName, boolean sendAsAttachment, Integer contentLength ); static Response.Status getEquivalentStatusFromHttpServletResponse( HttpServletResponse response );  }### Answer:
@Test public void testStatusCodeEquivalents() { OutputStream out = new ByteArrayOutputStream(); HttpServletResponse httpResponse = new HttpServletResponseForTesting( out ); httpResponse.setStatus( HttpServletResponse.SC_OK ); Response.Status respStatus = CpkUtils.getEquivalentStatusFromHttpServletResponse( httpResponse ); assertEquals( Response.Status.OK, respStatus ); httpResponse.setStatus( HttpServletResponse.SC_INTERNAL_SERVER_ERROR ); respStatus = CpkUtils.getEquivalentStatusFromHttpServletResponse( httpResponse ); assertEquals( Response.Status.INTERNAL_SERVER_ERROR, respStatus ); httpResponse.setStatus( HttpServletResponse.SC_NO_CONTENT ); respStatus = CpkUtils.getEquivalentStatusFromHttpServletResponse( httpResponse ); assertEquals( Response.Status.NO_CONTENT, respStatus ); httpResponse.setStatus( HttpServletResponse.SC_FORBIDDEN ); respStatus = CpkUtils.getEquivalentStatusFromHttpServletResponse( httpResponse ); assertEquals( Response.Status.FORBIDDEN, respStatus ); }