@Test
public void createOutputStreamBasedGeneratorReplacesDelegateTarget() throws IOException {

    // given
    SingleThreadJsonFactory factory = new SingleThreadJsonFactory();
    OutputStream os1 = mock(OutputStream.class);
    factory.createGenerator(os1, JsonEncoding.UTF8);
    assertSame(factory.outputStreamDelegate.getDelegate(), os1);
    // when
    OutputStream os2 = mock(OutputStream.class);
    factory.createGenerator(os2, JsonEncoding.UTF8);
    // then
    assertSame(factory.outputStreamDelegate.getDelegate(), os2);
}