CachingMap extends HashMap<K, V> { public boolean isCacheLoaded() { return cacheLoadCount > 0; }  V get( K key, Callable<V> callable ); V get( K key, Callable<V> callable, V defaultValue ); CachingMap<K, V> load( Collection<V> collection, Function<V, K> keyMapper ); long getCacheHitCount(); long getCacheMissCount(); double getCacheHitRatio(); long getCacheLoadCount(); boolean isCacheLoaded(); @Override String toString();  }
@Test public void testIsCacheLoaded() { Set<Animal> animals = new HashSet<>(); animals.add( new Animal( 1, "horse" ) ); animals.add( new Animal( 3, "cat" ) ); CachingMap<Integer, Animal> cache = new CachingMap<Integer, Animal>(); assertFalse( cache.isCacheLoaded() ); cache.load( animals, a -> a.getId() ); assertTrue( cache.isCacheLoaded() ); }