CombinedComparatorImpl implements CombinedComparator<ENTITY> { @Override public Comparator<ENTITY> thenComparing(Comparator<? super ENTITY> other) { return then(other); } CombinedComparatorImpl(
            final List<FieldComparator<? super ENTITY>> comparators); @Override Stream<FieldComparator<? super ENTITY>> stream(); @Override int size(); @Override int compare(ENTITY o1, ENTITY o2); @Override CombinedComparator<ENTITY> reversed(); @Override Comparator<ENTITY> thenComparing(Comparator<? super ENTITY> other); @Override Comparator<ENTITY> thenComparing(
            final Function<? super ENTITY, ? extends U> keyExtractor,
            final Comparator<? super U> keyComparator); @Override Comparator<ENTITY> thenComparing(Function<? super ENTITY, ? extends U> keyExtractor); @Override Comparator<ENTITY> thenComparingInt(ToIntFunction<? super ENTITY> keyExtractor); @Override Comparator<ENTITY> thenComparingLong(ToLongFunction<? super ENTITY> keyExtractor); @Override Comparator<ENTITY> thenComparingDouble(ToDoubleFunction<? super ENTITY> keyExtractor); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test void thenComparing() throws Exception { comparatorsAndReverses().forEachOrdered(comp1 -> { final Comparator<Entity> mock1 = mockComparator( comp1.getField(), comp1.getNullOrder(), comp1.isReversed() ); comparatorsAndReverses().forEachOrdered(comp2 -> { final Comparator<Entity> mock2 = mockComparator( comp2.getField(), comp2.getNullOrder(), comp2.isReversed() ); final Comparator<Entity> mock = mock1.thenComparing(mock2); final Comparator<Entity> comp = comp1.thenComparing(comp2); final List<Entity> expected = list.stream().sorted(mock).collect(toList()); final List<Entity> actual = list.stream().sorted(comp).collect(toList()); assertEquals(actual, expected, format("Compare %s then %s (reversed) using %s", comp1.getField().identifier().getColumnId(), comp2.getField().identifier().getColumnId(), comp ) ); }); }); }