Sort members
This commit is contained in:
parent
b19c82a7ce
commit
67336ab252
|
@ -136,6 +136,14 @@ public class StreamsTest extends AbstractLangTest {
|
||||||
assertEquals(2, Streams.instancesOf(String.class, objects).collect(Collectors.toList()).size());
|
assertEquals(2, Streams.instancesOf(String.class, objects).collect(Collectors.toList()).size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testNonNull() {
|
||||||
|
assertEquals(0, Streams.nonNull().collect(Collectors.toList()).size());
|
||||||
|
assertEquals(1, Streams.nonNull("A").collect(Collectors.toList()).size());
|
||||||
|
assertEquals(1, Streams.nonNull("A", null).collect(Collectors.toList()).size());
|
||||||
|
assertEquals(1, Streams.nonNull(null, "A").collect(Collectors.toList()).size());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNullSafeStreamNotNull() {
|
public void testNullSafeStreamNotNull() {
|
||||||
assertEquals(2, Streams.nonNull(Arrays.asList("A", "B")).collect(Collectors.toList()).size());
|
assertEquals(2, Streams.nonNull(Arrays.asList("A", "B")).collect(Collectors.toList()).size());
|
||||||
|
@ -203,14 +211,6 @@ public class StreamsTest extends AbstractLangTest {
|
||||||
assertEquals(0, Streams.of(input).collect(Collectors.toList()).size());
|
assertEquals(0, Streams.of(input).collect(Collectors.toList()).size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testNonNull() {
|
|
||||||
assertEquals(0, Streams.nonNull().collect(Collectors.toList()).size());
|
|
||||||
assertEquals(1, Streams.nonNull("A").collect(Collectors.toList()).size());
|
|
||||||
assertEquals(1, Streams.nonNull("A", null).collect(Collectors.toList()).size());
|
|
||||||
assertEquals(1, Streams.nonNull(null, "A").collect(Collectors.toList()).size());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSimpleStreamFilter() {
|
public void testSimpleStreamFilter() {
|
||||||
final List<String> input = Arrays.asList("1", "2", "3", "4", "5", "6");
|
final List<String> input = Arrays.asList("1", "2", "3", "4", "5", "6");
|
||||||
|
|
Loading…
Reference in New Issue