FeatureMap implements Map<Object, Boolean> { @Override public int size() { return manager.getFeatures().size(); } FeatureMap();  FeatureMap(FeatureManager manager); @Override Boolean get(Object key); @Override int size(); @Override boolean isEmpty(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override Boolean put(Object key, Boolean value); @Override Boolean remove(Object key); @Override void putAll(Map<? extends Object, ? extends Boolean> m); @Override void clear(); @Override Set<Object> keySet(); @Override Collection<Boolean> values(); @Override Set<Map.Entry<Object, Boolean>> entrySet();  }
@Test void shouldReturnCorrectSize() { List<Feature> features = Arrays.<Feature>asList( new NamedFeature("f1"), new NamedFeature("f2") ); FeatureManager featureManager = mock(FeatureManager.class); when(featureManager.getFeatures()).thenReturn(new HashSet<Feature>(features)); FeatureMap map = new FeatureMap(featureManager); assertEquals(2, map.size()); }