Skip to content

Commit 99ae92c

Browse files
committed
Add org.apache.commons.io.function.IOStreamTest.testAdaptParallelAndCount()
1 parent b75597b commit 99ae92c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff 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 {

0 commit comments

Comments
 (0)