@Test
public void shouldCreateJaxbInstanceForFirstCallFromSimpleObjectAndReuseItForMarshallCallWithSameObjectType() throws Exception {

    Object toMarshal = new Object();
    Object toMarshal2 = new Object();
    String toMarshal3 = new String();
    OutputStream outputStream = mock(OutputStream.class);
    Charset charset = Values.UTF8;
    Jaxb mockJaxb = mock(Jaxb.class);
    Jaxb mockJaxb2 = mock(Jaxb.class);
    mockStatic(JaxbFactory.class);
    when(JaxbFactory.create(mockCRestConfig, getClass(), new Class<?>[]{Object.class})).thenReturn(mockJaxb);
    when(JaxbFactory.create(mockCRestConfig, getClass(), new Class<?>[]{String.class})).thenReturn(mockJaxb2);
    toTest.marshal(toMarshal,outputStream,charset);
    toTest.marshal(toMarshal2,outputStream,charset);
    toTest.marshal(toMarshal3,outputStream,charset);
    verify(mockJaxb).marshal(toMarshal,outputStream,charset);
    verify(mockJaxb).marshal(toMarshal2,outputStream,charset);
    verify(mockJaxb2).marshal(toMarshal3,outputStream,charset);
}