@Test public void forEach() { Mock<String> map = new Mock<>("a", "b", "c"); map.put("a", new IntOption(0)); map.put("b", new IntOption(1)); map.put("c", new IntOption(2)); Map<String, IntOption> copy = new HashMap<>(); map.forEach((k, v) -> { assertThat(copy.putIfAbsent(k, v), is(nullValue())); }); assertThat(copy, is(map)); }
@Override public void forEach(BiConsumer<? super K, ? super V> action) { entrySet0().forEach(action); }
ValueOptionMap extends AbstractMap<K, V> { @Override public void forEach(BiConsumer<? super K, ? super V> action) { entrySet0().forEach(action); } }
ValueOptionMap extends AbstractMap<K, V> { @Override public void forEach(BiConsumer<? super K, ? super V> action) { entrySet0().forEach(action); }  }
ValueOptionMap extends AbstractMap<K, V> { @Override public void forEach(BiConsumer<? super K, ? super V> action) { entrySet0().forEach(action); }  @SafeVarargs static Set<T> keys(T... keys); @Override abstract V get(Object key); @Override V put(K key, V value); @Override abstract Set<K> keySet(); @Override boolean containsKey(Object key); @Override Set<Map.Entry<K, V>> entrySet(); @Override int size(); @Override void forEach(BiConsumer<? super K, ? super V> action); }
ValueOptionMap extends AbstractMap<K, V> { @Override public void forEach(BiConsumer<? super K, ? super V> action) { entrySet0().forEach(action); }  @SafeVarargs static Set<T> keys(T... keys); @Override abstract V get(Object key); @Override V put(K key, V value); @Override abstract Set<K> keySet(); @Override boolean containsKey(Object key); @Override Set<Map.Entry<K, V>> entrySet(); @Override int size(); @Override void forEach(BiConsumer<? super K, ? super V> action);  }