### Question:
FailedItemMarshaller implements BytesWriter<ItemSource>, BytesReader<ItemSource>,
        ReadResolvable<FailedItemMarshaller> { @Override public FailedItemMarshaller readResolve() { if (objectMapper != null) { return this; } this.objectMapper = createConfiguredObjectMapper(); return this; } FailedItemMarshaller(); ObjectMapper objectMapper(); @Override void writeMarshallable(@NotNull WireOut wire); @Override void readMarshallable(@NotNull WireIn wire); @Override FailedItemMarshaller readResolve(); @Override ItemSource read(Bytes in, @Nullable ItemSource using); @Override void write(Bytes out, @NotNull ItemSource toWrite);  }### Answer:
@Test public void readResolveCreatesMapperOnlyOnce() { ObjectMapper configuredObjectMapper = new ObjectMapper(); AtomicInteger callCount = new AtomicInteger(); FailedItemMarshaller failedItemMarshaller = new FailedItemMarshaller() { @Override ObjectMapper createConfiguredObjectMapper() { callCount.incrementAndGet(); return configuredObjectMapper; } }; failedItemMarshaller.readResolve(); failedItemMarshaller.readResolve(); assertEquals(1, callCount.get()); }