SyncCacheWrapper implements SyncCache<K, V> { public static <K, V> Builder<K, V> newBuilder(Class<K> keyType, Class<V> valueType) { return new Builder<K, V>().setKeyType(keyType).setValueType(valueType); } private  SyncCacheWrapper(Builder<K, V> config); @Override V get(K key); @Override V put(K key, V value, long expiry, TimeUnit unit); @Override K remove(K key); @Override Map<K, V> getAll(Collection<K> keys); @Override Map<K, V> putAll(Map<K, V> map, long expiry, TimeUnit unit); @Override Collection<K> removeAll(Collection<K> keys); static Builder<K, V> newBuilder(Class<K> keyType, Class<V> valueType);  }
@Test(expected = IllegalArgumentException.class) public void testNullKeyType(){ SyncCacheWrapper.newBuilder(null, String.class) .setDelegate((FutureCache<Object, String>) mock(FutureCache.class)) .build(); }
@Test(expected = IllegalArgumentException.class) public void testNullValueType(){ SyncCacheWrapper.newBuilder(String.class, null) .setDelegate((FutureCache<String, Object>) mock(FutureCache.class)) .build(); }
@Test(expected = IllegalArgumentException.class) public void testNullDelegate(){ SyncCacheWrapper.newBuilder(String.class, String.class) .build(); }
@Test(expected = IllegalArgumentException.class) public void testNullDelegate2(){ SyncCacheWrapper.newBuilder(String.class, String.class) .setDelegate(null) .build(); }