Skip to content

Commit

Permalink
Have ReverseOrder rule flag `Collections.reverseOrder(String::compa…
Browse files Browse the repository at this point in the history
…reTo)`
  • Loading branch information
rickie committed Dec 8, 2022
1 parent b1c8157 commit cf38b37
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ static final class ReverseOrder<T extends Comparable<? super T>> {
Comparator<T> before() {
return Refaster.anyOf(
Collections.reverseOrder(),
Collections.reverseOrder(T::compareTo),
Collections.<T>reverseOrder(naturalOrder()),
Comparator.<T>naturalOrder().reversed());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ ImmutableSet<Comparator<String>> testNaturalOrder() {
ImmutableSet<Comparator<String>> testReverseOrder() {
return ImmutableSet.of(
Collections.reverseOrder(),
Collections.reverseOrder(String::compareTo),
Collections.<String>reverseOrder(naturalOrder()),
Comparator.<String>naturalOrder().reversed());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ ImmutableSet<Comparator<String>> testNaturalOrder() {

ImmutableSet<Comparator<String>> testReverseOrder() {
return ImmutableSet.of(
Comparator.reverseOrder(), Comparator.reverseOrder(), Comparator.reverseOrder());
Comparator.reverseOrder(),
Comparator.reverseOrder(),
Comparator.reverseOrder(),
Comparator.reverseOrder());
}

ImmutableSet<Comparator<String>> testCustomComparator() {
Expand Down

0 comments on commit cf38b37

Please sign in to comment.