### Question:
FunctionListMap implements DisposableMap<K, V> { @Override public Set<Entry<K, V>> entrySet() { if (this.entrySet == null) this.entrySet = new EntrySet(); return this.entrySet; } FunctionListMap(EventList<V> source, FunctionList.Function<V, K> keyFunction); @Override void dispose(); @Override int size(); @Override boolean isEmpty(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override V get(Object key); @Override V put(K key, V value); @Override void putAll(Map<? extends K, ? extends V> m); @Override void clear(); @Override V remove(Object key); @Override Collection<V> values(); @Override Set<K> keySet(); @Override Set<Entry<K, V>> entrySet(); @Override void forEach(BiConsumer<? super K, ? super V> action); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testEntrySet() { final EventList<String> source = new BasicEventList<>(); final Map<String, String> eventMap = GlazedLists.syncEventListToMap(source, new FirstLetterFunction()); assertTrue(eventMap.isEmpty()); assertTrue(eventMap.entrySet().isEmpty()); source.addAll(GlazedListsTests.delimitedStringToList("James Lemieux Andy Depue Holger Brands")); assertEquals(6, source.size()); assertEquals(6, eventMap.size()); assertEquals(6, eventMap.entrySet().size()); assertFalse(eventMap.entrySet().contains(null)); assertTrue(eventMap.entrySet().remove(eventMap.entrySet().iterator().next())); assertEquals(5, source.size()); assertEquals(5, eventMap.size()); assertEquals(5, eventMap.entrySet().size()); assertTrue(eventMap.entrySet().remove(eventMap.entrySet().iterator().next())); assertEquals(4, source.size()); assertEquals(4, eventMap.size()); assertEquals(4, eventMap.entrySet().size()); eventMap.entrySet().clear(); assertEquals(0, source.size()); assertEquals(0, eventMap.size()); assertEquals(0, eventMap.entrySet().size()); assertTrue(source.isEmpty()); assertTrue(eventMap.isEmpty()); assertTrue(eventMap.entrySet().isEmpty()); }
@Test public void testMapEntrySetValue() { final EventList<String> source = new BasicEventList<>(); final Map<String, String> eventMap = GlazedLists.syncEventListToMap(source, new FirstLetterFunction()); source.addAll(GlazedListsTests.delimitedStringToList("James Lemieux Andy Depue Holger Brands")); Iterator<Map.Entry<String, String>> entrySetIter = eventMap.entrySet().iterator(); Map.Entry<String, String> entry; assertTrue(entrySetIter.hasNext()); entry = entrySetIter.next(); assertEquals("J", entry.getKey()); assertEquals("James", entry.getValue()); entry.setValue("Jesse"); assertEquals("J", entry.getKey()); assertEquals("Jesse", entry.getValue()); try { entry.setValue("Xavier"); fail("failed to receive an IllegalArgumentException for a value to Entry.setValue() that does not produce the correct Entry.getKey()"); } catch (IllegalArgumentException e) { } }