public void testHit() {
    CharacterObjectStorage storage = mock(CharacterObjectStorage.class);

    CharacterIntCache cache =
        (CharacterIntCache)
            Wrapping.getFactory(
                    new Signature(char.class, Object.class),
                    new Signature(char.class, int.class),
                    false)
                .wrap("123", CALCULATABLE, storage, new MutableStatisticsImpl());
    cache.setDependencyNode(DependencyTracker.DUMMY_NODE);

    when(storage.load('*')).thenReturn(42);
    when(storage.size()).thenReturn(1);

    assert cache.getSize() == 1;
    assert cache.getStatistics().getHits() == 0;
    assert cache.getStatistics().getMisses() == 0;

    assert cache.getOrCreate('*') == 42;

    assert cache.getStatistics().getHits() == 1;
    assert cache.getStatistics().getMisses() == 0;

    verify(storage).size();
    verify(storage, atLeast(2)).load('*');
    verifyNoMoreInteractions(storage);
  }