### Question:
SpringCache2kCacheManager implements CacheManager { @SafeVarargs public final SpringCache2kCacheManager addCaches( Function<Cache2kBuilder<?, ?>, Cache2kBuilder<?, ?>>... fs) { for (Function<Cache2kBuilder<?, ?>, Cache2kBuilder<?, ?>> f : fs) { addCache(f.apply(defaultSetup.apply(getDefaultBuilder()))); } return this; } SpringCache2kCacheManager();  SpringCache2kCacheManager(String name);  SpringCache2kCacheManager(org.cache2k.CacheManager manager); @Override SpringCache2kCache getCache(String name); SpringCache2kCacheManager defaultSetup(
    Function<Cache2kBuilder<?, ?>, Cache2kBuilder<?, ?>> f); @SafeVarargs final SpringCache2kCacheManager addCaches(
    Function<Cache2kBuilder<?, ?>, Cache2kBuilder<?, ?>>... fs); void setCaches(Collection<Cache2kConfiguration<?, ?>> cacheConfigurationList); @Override Collection<String> getCacheNames(); Collection<String> getConfiguredCacheNames(); org.cache2k.CacheManager getNativeCacheManager(); Map<String, SpringCache2kCache> getCacheMap(); boolean isAllowUnknownCache(); void setAllowUnknownCache(boolean v); static final String DEFAULT_SPRING_CACHE_MANAGER_NAME; }### Answer:
@Test(expected = IllegalArgumentException.class) public void nameAndManagerMissing() { SpringCache2kCacheManager m = getManager(); m.addCaches(b -> Cache2kBuilder.forUnknownTypes()); }
@Test(expected = IllegalArgumentException.class) public void managerMissing() { SpringCache2kCacheManager m = getManager(); m.addCaches(b -> Cache2kBuilder.forUnknownTypes().name("abc")); }
@Test public void testAddCaches() { SpringCache2kCacheManager m = new SpringCache2kCacheManager( SpringCache2KCacheManagerTest.class.getSimpleName() + "addCaches"); m.addCaches(b -> b.name("cache1")); assertNotNull(m.getCache("cache1")); assertTrue(m.getConfiguredCacheNames().contains("cache1")); }