@Test public void testOrderBy() { List<TestCls> list = buildList(); List<TestCls> result = ListUtil.orderBy(list, TestCls::getName, true); assertArrayEquals(new TestCls[] {list.get(3), list.get(1), list.get(0), list.get(2)}, result.toArray()); result = ListUtil.orderBy(list, F_NAME); assertArrayEquals(new TestCls[] {list.get(0), list.get(2), list.get(1), list.get(3)}, result.toArray()); }
public static <V, C extends Collection<? extends V>> List<V> orderBy( C source, final Function<? super V, ? extends Comparable> by) { return orderBy(source, by, false); }
ListUtil { public static <V, C extends Collection<? extends V>> List<V> orderBy( C source, final Function<? super V, ? extends Comparable> by) { return orderBy(source, by, false); } }
ListUtil { public static <V, C extends Collection<? extends V>> List<V> orderBy( C source, final Function<? super V, ? extends Comparable> by) { return orderBy(source, by, false); }  }
ListUtil { public static <V, C extends Collection<? extends V>> List<V> orderBy( C source, final Function<? super V, ? extends Comparable> by) { return orderBy(source, by, false); }  static C map(
      Collection<? extends TSrc> source, BiFunction<? super TSrc, Integer, ? extends TDest> func, C dest); static C map(
      Collection<? extends TSrc> source, Function<? super TSrc, ? extends TDest> func, C dest); static List<TDest> map(
      Collection<? extends TSrc> source, BiFunction<? super TSrc, Integer, ? extends TDest> func); static List<TDest> map(
      Collection<? extends TSrc> source, Function<? super TSrc, ? extends TDest> func); static C flatMap(Collection<? extends TSrc> source,
      BiFunction<? super TSrc, Integer, ? extends Collection< ? extends TDest>> func, C dest); static C flatMap(
      Collection<? extends TSrc> source, Function<? super TSrc, ? extends Collection< ? extends TDest>> func, C dest); static List<TDest> flatMap(Collection<? extends TSrc> source,
      BiFunction<? super TSrc, Integer, ? extends Collection< ? extends TDest>> func); static List<TDest> flatMap(
      Collection<? extends TSrc> source, Function<? super TSrc, ? extends Collection< ? extends TDest>> func); static Set<TDest> unique(
      Collection<? extends TSrc> source, Function<? super TSrc, ? extends TDest> func); static List<TId> getIds(Collection<? extends Identifiable<TId>> identifiables); static Map<K, List<E>> groupBy(
      Collection<? extends E> source, Function<? super E, ? extends K> classifier); static Map<TK, TV> map(Map<? extends K, ? extends V> source,
      Function<? super K, ? extends TK> keyFunc, Function<? super V, ? extends TV> valFunc); static Map<K, TV> mapValues(
      Map<? extends K, ? extends V> source, Function<? super V, ? extends TV> valFunc); static Map<TK, V> mapKeys(
      Map<? extends K, ? extends V> source, Function<? super K, ? extends TK> keyFunc); static long[] toLongArray(Collection<Object> list); static Map<K, V> toMap(Collection<V> source, Function<? super V, ? extends K> keyFunc); static Map<K, V> toMap(
      Collection<S> source, Function<? super S, ? extends K> keyFunc, Function<? super S, ? extends V> valFunc); static D filter(
      S source, Predicate<? super V> pred, D dest); static List<V> filter(C source, Predicate<? super V> pred); static List<V> orderBy(
      C source, final Function<? super V, ? extends Comparable> by); static List<V> orderBy(
      C src, final Function<? super V, K> by, final boolean desc); static boolean contains(long[] longs, long match); static String join(T[] list, String delimiter); static String join(Collection<T> list, String delimiter); static boolean exists(C source, Predicate<? super V> pred); static V first(C source, Predicate<? super V> pred); static int indexOf(C source, Predicate<? super V> pred); static D takeBetween(
      S source, Predicate<? super V> dropPred, Predicate<? super V> whilePred, D dest); static List<V> takeBetween(
      S source, Predicate<? super V> dropPred, Predicate<? super V> whilePred); static D takeWhile(
      S source, Predicate<? super V> pred, D dest); static List<V> takeWhile(S source, Predicate<? super V> pred); static D dropWhile(
      S source, Predicate<? super V> pred, D dest); static List<V> dropWhile(S source, Predicate<? super V> pred); static T last(List<T> list); static T first(Collection<T> list); static boolean containsAny(Collection<T> list, T... elements); static void removeLast(List<?> list); static Set<T> setOf(T... e); static M mergeWith(M target, Map<? extends K, ? extends V> source,
      BiFunction<? super V, ? super V, ? extends V> mergeFunc); static M mergeWith(
      M target, Map<? extends K, ? extends L> source); }
ListUtil { public static <V, C extends Collection<? extends V>> List<V> orderBy( C source, final Function<? super V, ? extends Comparable> by) { return orderBy(source, by, false); }  static C map(
      Collection<? extends TSrc> source, BiFunction<? super TSrc, Integer, ? extends TDest> func, C dest); static C map(
      Collection<? extends TSrc> source, Function<? super TSrc, ? extends TDest> func, C dest); static List<TDest> map(
      Collection<? extends TSrc> source, BiFunction<? super TSrc, Integer, ? extends TDest> func); static List<TDest> map(
      Collection<? extends TSrc> source, Function<? super TSrc, ? extends TDest> func); static C flatMap(Collection<? extends TSrc> source,
      BiFunction<? super TSrc, Integer, ? extends Collection< ? extends TDest>> func, C dest); static C flatMap(
      Collection<? extends TSrc> source, Function<? super TSrc, ? extends Collection< ? extends TDest>> func, C dest); static List<TDest> flatMap(Collection<? extends TSrc> source,
      BiFunction<? super TSrc, Integer, ? extends Collection< ? extends TDest>> func); static List<TDest> flatMap(
      Collection<? extends TSrc> source, Function<? super TSrc, ? extends Collection< ? extends TDest>> func); static Set<TDest> unique(
      Collection<? extends TSrc> source, Function<? super TSrc, ? extends TDest> func); static List<TId> getIds(Collection<? extends Identifiable<TId>> identifiables); static Map<K, List<E>> groupBy(
      Collection<? extends E> source, Function<? super E, ? extends K> classifier); static Map<TK, TV> map(Map<? extends K, ? extends V> source,
      Function<? super K, ? extends TK> keyFunc, Function<? super V, ? extends TV> valFunc); static Map<K, TV> mapValues(
      Map<? extends K, ? extends V> source, Function<? super V, ? extends TV> valFunc); static Map<TK, V> mapKeys(
      Map<? extends K, ? extends V> source, Function<? super K, ? extends TK> keyFunc); static long[] toLongArray(Collection<Object> list); static Map<K, V> toMap(Collection<V> source, Function<? super V, ? extends K> keyFunc); static Map<K, V> toMap(
      Collection<S> source, Function<? super S, ? extends K> keyFunc, Function<? super S, ? extends V> valFunc); static D filter(
      S source, Predicate<? super V> pred, D dest); static List<V> filter(C source, Predicate<? super V> pred); static List<V> orderBy(
      C source, final Function<? super V, ? extends Comparable> by); static List<V> orderBy(
      C src, final Function<? super V, K> by, final boolean desc); static boolean contains(long[] longs, long match); static String join(T[] list, String delimiter); static String join(Collection<T> list, String delimiter); static boolean exists(C source, Predicate<? super V> pred); static V first(C source, Predicate<? super V> pred); static int indexOf(C source, Predicate<? super V> pred); static D takeBetween(
      S source, Predicate<? super V> dropPred, Predicate<? super V> whilePred, D dest); static List<V> takeBetween(
      S source, Predicate<? super V> dropPred, Predicate<? super V> whilePred); static D takeWhile(
      S source, Predicate<? super V> pred, D dest); static List<V> takeWhile(S source, Predicate<? super V> pred); static D dropWhile(
      S source, Predicate<? super V> pred, D dest); static List<V> dropWhile(S source, Predicate<? super V> pred); static T last(List<T> list); static T first(Collection<T> list); static boolean containsAny(Collection<T> list, T... elements); static void removeLast(List<?> list); static Set<T> setOf(T... e); static M mergeWith(M target, Map<? extends K, ? extends V> source,
      BiFunction<? super V, ? super V, ? extends V> mergeFunc); static M mergeWith(
      M target, Map<? extends K, ? extends L> source);  }