Skip to content

Commit b75597b

Browse files
committed
Add org.apache.commons.io.function.IOStreamTest.testAdaptAsParallel()
1 parent 82393b1 commit b75597b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/test/java/org/apache/commons/io/function/IOStreamTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ public void testAdapt() {
7272
assertEquals(1, IOStream.adapt(Stream.of("A")).count());
7373
}
7474

75+
@SuppressWarnings("resource") // custom stream not recognized by compiler warning machinery
76+
@Test
77+
public void testAdaptAsParallel() {
78+
assertEquals(0, IOStream.adapt((Stream<?>) null).parallel().count());
79+
assertEquals(0, IOStream.adapt(Stream.empty()).parallel().count());
80+
assertEquals(1, IOStream.adapt(Stream.of("A")).parallel().count());
81+
}
82+
7583
@SuppressWarnings("resource") // custom stream not recognized by compiler warning machinery
7684
@Test
7785
public void testAllMatch() throws IOException {

0 commit comments

Comments
 (0)