@Test
public void shouldCreateAPooledJaxbWithJaxContextCreateWithGivenClassToBeBound() throws Exception {

    Class<?>[] classesToBeBound = new Class<?>[0];
    PooledJaxb mockPooledJaxb = mock(PooledJaxb.class);
    when(mockCRestConfig.getConcurrencyLevel()).thenReturn(2);
    when(mockCRestConfig.get(getClass().getName() + JaxbFactory.POOL_RETRIEVAL_MAX_WAIT, 30000l)).thenReturn(123l);
    mockStatic(JAXBContext.class);
    when(JAXBContext.newInstance(classesToBeBound)).thenReturn(mockJaxbContext);
    whenNew(PooledJaxb.class).withArguments(any(JAXBContext.class), anyInt(), anyLong()).thenReturn(mockPooledJaxb);
    Jaxb actual = JaxbFactory.create(mockCRestConfig, getClass(), classesToBeBound);
    assertTrue(actual instanceof PooledJaxb);
    verifyNew(PooledJaxb.class).withArguments(mockJaxbContext, 2, 123l);
}