DefaultCacheManager implements CacheManager { @Override public Collection<Cache> getCaches() { return new HashSet<>(cachesMap.values()); } DefaultCacheManager(); @Override Collection<Cache> getCaches(); @Override Cache getCache(String name); @Override Cache putCache(String name, int maxElementsInMemory); @Override Collection<String> getCacheNames(); @Override void clearAllEntries(); @Override boolean cacheExists(String name);  }
@Test public void testGetCaches() { String name = getRandomString(); Cache<String, String> cache = cacheMgr.putCache(name, 5); Cache<String, String> cache2 = cacheMgr.putCache(name + "2", 5); Set<Cache> expected = new HashSet<>(); expected.add(cache); expected.add(cache2); assertEquals("invalid caches found", expected, cacheMgr.getCaches()); }