### Question:
JacksonRepresentationFactory { public <T> JacksonRepresentation<T> create(T object) { JacksonRepresentation<T> representation = new JacksonRepresentation<>(object); representation.setObjectMapper(objectMapper); return representation; } @Inject  JacksonRepresentationFactory(ObjectMapper objectMapper); JacksonRepresentation<T> create(T object); JacksonRepresentation<T> create(Representation representation, Class<T> type);  }### Answer:
@Test public void shouldUseTheSameObjectMapperEveryTime() throws Exception { ObjectMapper mapper = new ObjectMapper(); JacksonRepresentationFactory factory = new JacksonRepresentationFactory(mapper); HashMap<Object, Object> body = new HashMap<>(); JacksonRepresentation<HashMap<Object, Object>> representation = factory.create(body); assertThat(representation.getObjectMapper()).isSameAs(mapper); assertThat(representation.getObject()).isSameAs(body); }