Class ExpectedOrderSorter<T>
java.lang.Object
org.javimmutable.collections.common.ExpectedOrderSorter<T>
Class intended for use in unit tests to simplify sorting collections based on
a standard ordering. The standard ordering comes from the order that values
appear in an Iterator. During sorting process any values encountered in collection
that did not appear in the Iterator trigger an IllegalArgumentException.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<U,
C extends Collection<U>>
List<U> Creates a new List containing all of the elements of collection sorted based on the Iterator.<U> Iterator
<U> Creates a new List containing all of the elements of collection sorted based on the Iterator.
-
Constructor Details
-
ExpectedOrderSorter
-
-
Method Details
-
sort
public <U,C extends Collection<U>> List<U> sort(@Nonnull C collection, @Nonnull java.util.function.Function<U, T> mapper) Creates a new List containing all of the elements of collection sorted based on the Iterator. -
sort
public <U> Iterator<U> sort(@Nonnull Iterator<U> iterator, @Nonnull java.util.function.Function<U, T> mapper) Creates a new List containing all of the elements of collection sorted based on the Iterator.
-