@Test public void testSort() { EntryList<String, String> list = new EntryList<>(); list.addEntry( "2", "value2" ); list.addEntry( "1", "value1" ); Iterator<SimpleImmutableEntry<String, String>> iterator1 = list.iterator(); Assert.assertEquals( "value2", iterator1.next().getValue() ); Assert.assertEquals( "value1", iterator1.next().getValue() ); list.sort( EntryList.getStringComparator( Constants.STRING_NUMBER_COMPARATOR ) ); Iterator<SimpleImmutableEntry<String, String>> iterator2 = list.iterator(); Assert.assertEquals( "value1", iterator2.next().getValue() ); Assert.assertEquals( "value2", iterator2.next().getValue() ); }
public void sort( final Comparator<? super SimpleImmutableEntry<K, V>> c ) { Collections.sort( this.entries, c ); }
EntryList implements Iterable<SimpleImmutableEntry<K, V>> { public void sort( final Comparator<? super SimpleImmutableEntry<K, V>> c ) { Collections.sort( this.entries, c ); } }
EntryList implements Iterable<SimpleImmutableEntry<K, V>> { public void sort( final Comparator<? super SimpleImmutableEntry<K, V>> c ) { Collections.sort( this.entries, c ); } EntryList();  EntryList( final int initialCapacity );  EntryList( final Collection<? extends SimpleImmutableEntry<K, V>> c );  EntryList( final EntryList<K, V> entryList ); }
EntryList implements Iterable<SimpleImmutableEntry<K, V>> { public void sort( final Comparator<? super SimpleImmutableEntry<K, V>> c ) { Collections.sort( this.entries, c ); } EntryList();  EntryList( final int initialCapacity );  EntryList( final Collection<? extends SimpleImmutableEntry<K, V>> c );  EntryList( final EntryList<K, V> entryList ); void addEntry( final K key, final V value ); int size(); void sort( final Comparator<? super SimpleImmutableEntry<K, V>> c ); @Override Iterator<SimpleImmutableEntry<K, V>> iterator(); static Comparator<SimpleImmutableEntry<String, ?>> getStringComparator( final Comparator<String> comparator ); }
EntryList implements Iterable<SimpleImmutableEntry<K, V>> { public void sort( final Comparator<? super SimpleImmutableEntry<K, V>> c ) { Collections.sort( this.entries, c ); } EntryList();  EntryList( final int initialCapacity );  EntryList( final Collection<? extends SimpleImmutableEntry<K, V>> c );  EntryList( final EntryList<K, V> entryList ); void addEntry( final K key, final V value ); int size(); void sort( final Comparator<? super SimpleImmutableEntry<K, V>> c ); @Override Iterator<SimpleImmutableEntry<K, V>> iterator(); static Comparator<SimpleImmutableEntry<String, ?>> getStringComparator( final Comparator<String> comparator );  }