### Question:
ResponseMapper { public <T, R> ResponseEntity<?> ok(ResponseObject<T> response, Function<T, R> mapper) { return generateResponse(response, OK, mapper); }  ResponseEntity<?> ok(ResponseObject<T> response, Function<T, R> mapper); ResponseEntity<?> created(ResponseObject<T> response, Function<T, R> mapper); ResponseEntity<?> delete(ResponseObject<T> response, Function<T, R> mapper); ResponseEntity<?> ok(ResponseObject<T> response, Function<T, R> mapper, ResponseHeaders responseHeaders); ResponseEntity<?> created(ResponseObject<T> response, Function<T, R> mapper, ResponseHeaders responseHeaders); ResponseEntity created(ResponseObject<T> response, ResponseHeaders responseHeaders); ResponseEntity ok(ResponseObject<T> response); ResponseEntity created(ResponseObject<T> response); ResponseEntity delete(ResponseObject<T> response); ResponseEntity accepted(ResponseObject<T> response);  }### Answer:
@Test void contentTypeSet() { CustomContentTypeProvider responseWithContentType = () -> MediaType.APPLICATION_PDF; ResponseObject<CustomContentTypeProvider> responseObject = ResponseObject .<CustomContentTypeProvider>builder() .body(responseWithContentType) .build(); ResponseEntity responseEntity = responseMapper.ok(responseObject); assertEquals(MediaType.APPLICATION_PDF, responseEntity.getHeaders().getContentType()); }
@Test void contentTypeNotSet() { ResponseObject<String> responseObject = ResponseObject.<String>builder() .body("some body") .build(); ResponseEntity responseEntity = responseMapper.ok(responseObject); assertNull(responseEntity.getHeaders().getContentType()); }