@Test public void testExplicitComparatorForUncomparableValues() { final EventList<UncomparableValue> source = new BasicEventList<>(); final FunctionList.Function<UncomparableValue, UncomparableKey> keyFunction = GlazedLists.beanFunction(UncomparableValue.class, "key"); final Map<UncomparableKey, List<UncomparableValue>> eventMap = GlazedLists.syncEventListToMultiMap(source, keyFunction, new UncomparableThingComparator()); final UncomparableKey key1 = new UncomparableKey("a"); final UncomparableKey key2 = new UncomparableKey("b"); final UncomparableKey key3 = new UncomparableKey("a"); final UncomparableValue value1 = new UncomparableValue(key1); final UncomparableValue value2 = new UncomparableValue(key2); final UncomparableValue value3 = new UncomparableValue(key3); source.add(value1); assertEquals(Collections.singletonList(value1), eventMap.get(key1)); assertNull(eventMap.get(key2)); assertEquals(Collections.singletonList(value1), eventMap.get(key3)); source.add(value2); assertEquals(Collections.singletonList(value1), eventMap.get(key1)); assertEquals(Collections.singletonList(value2), eventMap.get(key2)); assertEquals(Collections.singletonList(value1), eventMap.get(key3)); source.add(value3); assertEquals(Arrays.asList(value1, value3), eventMap.get(key1)); assertEquals(Collections.singletonList(value2), eventMap.get(key2)); assertEquals(Arrays.asList(value1, value3), eventMap.get(key3)); }
@Override public List<V> get(Object key) { return delegate.get(key); }
GroupingListMultiMap implements DisposableMap<K, List<V>>, ListEventListener<List<V>> { @Override public List<V> get(Object key) { return delegate.get(key); } }
GroupingListMultiMap implements DisposableMap<K, List<V>>, ListEventListener<List<V>> { @Override public List<V> get(Object key) { return delegate.get(key); } GroupingListMultiMap(EventList<V> source, FunctionList.Function<V, ? extends K> keyFunction, Comparator<? super K> keyGrouper); }
GroupingListMultiMap implements DisposableMap<K, List<V>>, ListEventListener<List<V>> { @Override public List<V> get(Object key) { return delegate.get(key); } GroupingListMultiMap(EventList<V> source, FunctionList.Function<V, ? extends K> keyFunction, Comparator<? super K> keyGrouper); @Override void dispose(); @Override int size(); @Override boolean isEmpty(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override List<V> get(Object key); @Override List<V> put(K key, List<V> value); @Override void putAll(Map<? extends K, ? extends List<V>> m); @Override void clear(); @Override List<V> remove(Object key); @Override Collection<List<V>> values(); @Override Set<K> keySet(); @Override Set<Entry<K, List<V>>> entrySet(); @Override boolean equals(Object o); @Override int hashCode(); @Override void listChanged(ListEvent<List<V>> listChanges); }
GroupingListMultiMap implements DisposableMap<K, List<V>>, ListEventListener<List<V>> { @Override public List<V> get(Object key) { return delegate.get(key); } GroupingListMultiMap(EventList<V> source, FunctionList.Function<V, ? extends K> keyFunction, Comparator<? super K> keyGrouper); @Override void dispose(); @Override int size(); @Override boolean isEmpty(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override List<V> get(Object key); @Override List<V> put(K key, List<V> value); @Override void putAll(Map<? extends K, ? extends List<V>> m); @Override void clear(); @Override List<V> remove(Object key); @Override Collection<List<V>> values(); @Override Set<K> keySet(); @Override Set<Entry<K, List<V>>> entrySet(); @Override boolean equals(Object o); @Override int hashCode(); @Override void listChanged(ListEvent<List<V>> listChanges);  }