@Test
public void readResolveCreatesMapperOnlyOnce() {

    // given
    ObjectMapper configuredObjectMapper = new ObjectMapper();
    AtomicInteger callCount = new AtomicInteger();
    FailedItemMarshaller failedItemMarshaller = new FailedItemMarshaller() {
        @Override
        ObjectMapper createConfiguredObjectMapper() {
            callCount.incrementAndGet();
            return configuredObjectMapper;
        }
    };
    // when
    failedItemMarshaller.readResolve();
    failedItemMarshaller.readResolve();
    // then
    assertEquals(1, callCount.get());
}