@Test public void put_null() { Mock<String> map = new Mock<>("a"); map.put("a", new IntOption(100)); map.put("a", null); assertThat(map, hasEntry("a", new IntOption())); }
@Override public V put(K key, V value) { V property = get(key); if (property == null) { throw new IllegalArgumentException(String.valueOf(key)); } return update(property, value); }
ValueOptionMap extends AbstractMap<K, V> { @Override public V put(K key, V value) { V property = get(key); if (property == null) { throw new IllegalArgumentException(String.valueOf(key)); } return update(property, value); } }
ValueOptionMap extends AbstractMap<K, V> { @Override public V put(K key, V value) { V property = get(key); if (property == null) { throw new IllegalArgumentException(String.valueOf(key)); } return update(property, value); }  }
ValueOptionMap extends AbstractMap<K, V> { @Override public V put(K key, V value) { V property = get(key); if (property == null) { throw new IllegalArgumentException(String.valueOf(key)); } return update(property, value); }  @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 V put(K key, V value) { V property = get(key); if (property == null) { throw new IllegalArgumentException(String.valueOf(key)); } return update(property, value); }  @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);  }