### Question:
UnsupportedMediaTypeExceptionMapper implements ExceptionMapper<UnsupportedMediaTypeException> { @Override public Response toResponse(UnsupportedMediaTypeException exception) { Response.Status status = Response.Status.UNSUPPORTED_MEDIA_TYPE; return Response.status(status).entity(exception.getErrorDescriptor()).build(); }  @Override Response toResponse(UnsupportedMediaTypeException exception);  }### Answer:
@Test public void toResponse(){ final Response result = new UnsupportedMediaTypeExceptionMapper() .toResponse(new UnsupportedMediaTypeException("application/json")); assertNotNull(result); assertNotNull(result.getEntity()); final ErrorDescriptor errorDescriptor = (ErrorDescriptor) result.getEntity(); assertEquals(errorDescriptor.getErrorCode(), "mediatype.not.supported"); assertNotNull(errorDescriptor.getProperties()); assertEquals(errorDescriptor.getProperties().get(0).getValue(), "application/json"); assertEquals(result.getStatus(), 415); }