garydgregory commented on code in PR #983:
URL: https://github.com/apache/commons-lang/pull/983#discussion_r1097991816


##########
src/test/java/org/apache/commons/lang3/stream/StreamsTest.java:
##########
@@ -136,25 +136,25 @@ public Stream<DynamicTest> simpleStreamForEachFailing() {
 
     @Test
     public void testInstanceOfStream() {
-        assertEquals(2, Streams.instancesOf(String.class, Arrays.asList("A", 
"B")).collect(Collectors.toList()).size());
-        assertEquals(2, Streams.instancesOf(String.class, Arrays.asList(null, 
"A", null, "B", null)).collect(Collectors.toList()).size());
-        assertEquals(0, Streams.instancesOf(String.class, Arrays.asList(null, 
null)).collect(Collectors.toList()).size());
+        assertEquals(2, (int) Streams.instancesOf(String.class, 
Arrays.asList("A", "B")).count());

Review Comment:
   Why clutter up the code with all these type-casts? Just let the compiler 
pick up the `long` version of the JUnit API IMO.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to