@Test public void sortedValuesTest() { SortedMap<Integer, String> sorted_map = new SortedMap<>(dataSet, cmp); String prev_val = null; for (String val: sorted_map.values()) { if (prev_val != null) { Assert.assertTrue(val.compareTo(prev_val) >= 0); } prev_val = val; } }
@Override public Collection<V> values() { return Collections.unmodifiableList(iterableValues); }
SortedMap implements Map<K, V> { @Override public Collection<V> values() { return Collections.unmodifiableList(iterableValues); } }
SortedMap implements Map<K, V> { @Override public Collection<V> values() { return Collections.unmodifiableList(iterableValues); } SortedMap(Map<K,V> to_sort, final Comparator<? super V> cmp); }
SortedMap implements Map<K, V> { @Override public Collection<V> values() { return Collections.unmodifiableList(iterableValues); } SortedMap(Map<K,V> to_sort, final Comparator<? super V> cmp); @Override int size(); @Override boolean isEmpty(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override V get(Object key); @Override Set<K> keySet(); @Override Collection<V> values(); @Override Set<Entry<K, V>> entrySet(); @Override V put(K key, V value); @Override V remove(Object key); @Override void putAll(Map<? extends K, ? extends V> m); @Override void clear(); }
SortedMap implements Map<K, V> { @Override public Collection<V> values() { return Collections.unmodifiableList(iterableValues); } SortedMap(Map<K,V> to_sort, final Comparator<? super V> cmp); @Override int size(); @Override boolean isEmpty(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override V get(Object key); @Override Set<K> keySet(); @Override Collection<V> values(); @Override Set<Entry<K, V>> entrySet(); @Override V put(K key, V value); @Override V remove(Object key); @Override void putAll(Map<? extends K, ? extends V> m); @Override void clear();  }