@Test
public void copyDoesNotUseSourceSharedComponents() {

    // given
    SingleThreadJsonFactory factory1 = new SingleThreadJsonFactory();
    factory1.dataOutputDelegate.setDelegate(mock(DataOutput.class));
    // when
    SingleThreadJsonFactory factory2 = factory1.copy();
    // then
    assertNotSame(factory1.outputStreamDelegate, factory2.outputStreamDelegate);
    assertNotSame(factory1.outputStreamDelegate.getDelegate(), factory2.outputStreamDelegate.getDelegate());
    assertNotSame(factory1.dataOutputDelegate, factory2.dataOutputDelegate);
    assertNotSame(factory1.dataOutputDelegate.getDelegate(), factory2.dataOutputDelegate.getDelegate());
    assertNotSame(factory1.ioContext, factory2.ioContext);
    assertNotSame(factory1.ioContext.getSourceReference(), factory2.ioContext.getSourceReference());
    assertNotSame(factory1.jsonGenerator, factory2.jsonGenerator);
    assertNotSame(factory1.writeCtxAccessor, factory2.writeCtxAccessor);
}