@Test
public void instanciateShouldDelegateAnyExceptionToCRestHandle() throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {

    RuntimeException expected = mock(RuntimeException.class);
    InvocationTargetException e = mock(InvocationTargetException.class);
    mockStatic(ComponentFactory.class);
    when(ComponentFactory.instantiate(String.class, mockCRestConfig)).thenThrow(e);
    
    mockStatic(CRestException.class);
    when(CRestException.handle((Exception)e)).thenReturn(expected);
    try {
        toTest.instantiate(String.class);
        fail();
    } catch (Exception e1) {
        assertSame(expected, e1);
    }
}