@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()); }
@Override public Set<Entry<K, V>> entrySet() { if (this.entrySet == null) this.entrySet = new EntrySet(); return this.entrySet; }
FunctionListMap implements DisposableMap<K, V> { @Override public Set<Entry<K, V>> entrySet() { if (this.entrySet == null) this.entrySet = new EntrySet(); return this.entrySet; } }
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); }
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(); }
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();  }