@SuppressWarnings("unchecked")
@Test
public void handlesLoadingExceptionProperly()
                                             throws Exception {

    cache = builder.build( TestEntity1.class );
    Callable<TestEntity1> loader = mock( Callable.class );
    when( loader.call() ).thenThrow( new IllegalStateException( "failed to load 123 key" ) );
    try {
        cache.get( "123", loader );
        Assert.fail();
    }
    catch ( ExecutionException e ) {
        assertThat( cache.stats().loadExceptionCount(), is( 1L ) );
        assertThat( e.getCause().getClass().getName(), is( IllegalStateException.class.getName() ) );
    }
}