@Test public void remove() { Options<Integer> opt = new Options<Integer>(); opt.put(1, "one"); Counter counter = new Counter(); opt.addOptionsListener(counter); opt.remove(1); assertEquals("opt.size()", 0, opt.size()); assertEquals("counter.changed", 1, counter.changed); assertEquals("opt.get(1)", null, opt.get(1)); }
public String remove(Object key) { String result = map.remove(key); if (result != null) { values.remove(result); this.fireChanged(); } return result; }
Options { public String remove(Object key) { String result = map.remove(key); if (result != null) { values.remove(result); this.fireChanged(); } return result; } }
Options { public String remove(Object key) { String result = map.remove(key); if (result != null) { values.remove(result); this.fireChanged(); } return result; }  }
Options { public String remove(Object key) { String result = map.remove(key); if (result != null) { values.remove(result); this.fireChanged(); } return result; }  Map<K, String> toMap(); void clear(); boolean containsKey(Object key); boolean containsValue(Object value); String get(Object key); K getKey(String value); boolean isEmpty(); Set<K> keySet(); String put(K key, String value); void putAll(Options other); void putAll(Map<K, String> aMap); String remove(Object key); Set<String> removeAll(Set<K> keys); int size(); Set<String> values(); String[] getValues(); int indexOf(String value); String getValue(int index); void addOptionsListener(OptionsListener l); void removeOptionsListener(OptionsListener l); static Options<T> create(T... values); }
Options { public String remove(Object key) { String result = map.remove(key); if (result != null) { values.remove(result); this.fireChanged(); } return result; }  Map<K, String> toMap(); void clear(); boolean containsKey(Object key); boolean containsValue(Object value); String get(Object key); K getKey(String value); boolean isEmpty(); Set<K> keySet(); String put(K key, String value); void putAll(Options other); void putAll(Map<K, String> aMap); String remove(Object key); Set<String> removeAll(Set<K> keys); int size(); Set<String> values(); String[] getValues(); int indexOf(String value); String getValue(int index); void addOptionsListener(OptionsListener l); void removeOptionsListener(OptionsListener l); static Options<T> create(T... values);  }