File tree Expand file tree Collapse file tree
src/test/java/org/apache/commons/io/function Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,6 +80,17 @@ public void testAdaptAsParallel() {
8080 assertEquals (1 , IOStream .adapt (Stream .of ("A" )).parallel ().count ());
8181 }
8282
83+ @ SuppressWarnings ("resource" ) // custom stream not recognized by compiler warning machinery
84+ @ Test
85+ public void testAdaptParallelAndCount () {
86+ final IOStream <Object > adaptedObj = IOStream .adapt (Stream .empty ().parallel ());
87+ assertTrue (adaptedObj .isParallel ());
88+ assertEquals (0 , adaptedObj .count ());
89+ final IOStream <String > adaptedStr = IOStream .adapt (Stream .of ("A" ).parallel ());
90+ assertTrue (adaptedObj .isParallel ());
91+ assertEquals (1 , adaptedStr .count ());
92+ }
93+
8394 @ SuppressWarnings ("resource" ) // custom stream not recognized by compiler warning machinery
8495 @ Test
8596 public void testAllMatch () throws IOException {
You can’t perform that action at this time.
0 commit comments