@Beta @GwtCompatible public final class CollectorTester<T,A,R> extends Object
Collector
implementations.
Example usage:
CollectorTester.of(Collectors.summingInt(Integer::parseInt)) .expectCollects(3, "1", "2") .expectCollects(10, "1", "4", "3", "2") .expectCollects(5, "-3", "0", "8");
Modifier and Type | Method and Description |
---|---|
CollectorTester<T,A,R> |
expectCollects(R expectedResult,
T... inputs)
Verifies that the specified expected result is always produced by collecting the
specified inputs, regardless of how the elements are divided.
|
static <T,A,R> CollectorTester<T,A,R> |
of(Collector<T,A,R> collector)
Creates a
CollectorTester for the specified Collector . |
static <T,A,R> CollectorTester<T,A,R> |
of(Collector<T,A,R> collector,
BiPredicate<? super R,? super R> equivalence)
Creates a
CollectorTester for the specified Collector . |
public static <T,A,R> CollectorTester<T,A,R> of(Collector<T,A,R> collector)
CollectorTester
for the specified Collector
. The result of the Collector
will be compared to the expected value using Object.equals
.public static <T,A,R> CollectorTester<T,A,R> of(Collector<T,A,R> collector, BiPredicate<? super R,? super R> equivalence)
CollectorTester
for the specified Collector
. The result of the Collector
will be compared to the expected value using the specified equivalence
.@SafeVarargs public final CollectorTester<T,A,R> expectCollects(@Nullable R expectedResult, T... inputs)
Copyright © 2010–2017. All rights reserved.