### Question:
CacheLoaderAdapter implements CacheLoader<K, V>, Factory<CacheLoader<K, V>> { @Override public Map<K, V> loadAll(final Iterable<? extends K> keys) throws CacheLoaderException { final Map<K, V> result = new HashMap<K, V>(); for (final K k : keys) { final V v = load(k); if (v != null) { result.put(k, v); } } return result; }  @Override Map<K, V> loadAll(final Iterable<? extends K> keys); @Override CacheLoader<K, V> create();  }### Answer:
@Test public void checkLoadAll() { assertFalse(cache.iterator().hasNext()); assertEquals("foo", cache.get("foo")); count.decrementAndGet(); cache.loadAll(new HashSet<String>(asList("a", "b")), true, null); int retries = 100; while (retries-- > 0 && count.get() != 2) { try { Thread.sleep(20); } catch (final InterruptedException e) { Thread.interrupted(); } } assertEquals(2, count.get()); assertEquals("a", cache.get("a")); assertEquals("b", cache.get("b")); assertEquals(2, count.get()); }