### Question:
Options { public void clear() { boolean isEmpty = this.isEmpty(); if (!isEmpty) { map.clear(); values.clear(); this.fireChanged(); } }  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);  }### Answer:
@Test public void clear() { Options<Integer> opt = new Options<Integer>(); opt.put(1, "one"); opt.put(2, "two"); Counter counter = new Counter(); opt.addOptionsListener(counter); opt.clear(); assertEquals("opt.size()", 0, opt.size()); assertEquals("counter.changed", 1, counter.changed); }