@Test public void testReadKeySetFromUnderlying() { final Set<String> expectedKeySet = new HashSet(); expectedKeySet.add(onKey); expectedKeySet.add(offKey); when(underlying.keySet()).thenReturn(expectedKeySet); final CachingToggleMap<String, Integer> toggleMap = new CachingToggleMap<>(underlying, CaffeineSpec.parse("maximumSize=3")); assertThat(toggleMap.keySet()).containsOnly(onKey, offKey); }
@Override public Set<K> keySet() { final Set<K> underlyingKeySet = underlying.keySet(); underlyingKeySet.forEach(cache::refresh); return underlyingKeySet; }
CachingToggleMap extends ToggleMap<K, T> { @Override public Set<K> keySet() { final Set<K> underlyingKeySet = underlying.keySet(); underlyingKeySet.forEach(cache::refresh); return underlyingKeySet; } }
CachingToggleMap extends ToggleMap<K, T> { @Override public Set<K> keySet() { final Set<K> underlyingKeySet = underlying.keySet(); underlyingKeySet.forEach(cache::refresh); return underlyingKeySet; } CachingToggleMap(ToggleMap<K, T> underlying, CaffeineSpec cacheSpec);  CachingToggleMap(ToggleMap<K, T> underlying, String cacheSpec); }
CachingToggleMap extends ToggleMap<K, T> { @Override public Set<K> keySet() { final Set<K> underlyingKeySet = underlying.keySet(); underlyingKeySet.forEach(cache::refresh); return underlyingKeySet; } CachingToggleMap(ToggleMap<K, T> underlying, CaffeineSpec cacheSpec);  CachingToggleMap(ToggleMap<K, T> underlying, String cacheSpec); @Override Toggle<T> apply(K key); @Override Set<K> keySet(); }
CachingToggleMap extends ToggleMap<K, T> { @Override public Set<K> keySet() { final Set<K> underlyingKeySet = underlying.keySet(); underlyingKeySet.forEach(cache::refresh); return underlyingKeySet; } CachingToggleMap(ToggleMap<K, T> underlying, CaffeineSpec cacheSpec);  CachingToggleMap(ToggleMap<K, T> underlying, String cacheSpec); @Override Toggle<T> apply(K key); @Override Set<K> keySet();  }