This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit ef2bde1d5a521c05d7f2cc6c00777a3d451bca66 Author: Gary D. Gregory <garydgreg...@gmail.com> AuthorDate: Sat Jun 14 13:51:59 2025 -0400 More tests --- .../java/org/apache/commons/lang3/stream/StreamsTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java b/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java index a4e153970..3ac4b074e 100644 --- a/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java +++ b/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java @@ -28,6 +28,7 @@ import java.lang.reflect.UndeclaredThrowableException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Enumeration; import java.util.Hashtable; import java.util.Iterator; import java.util.List; @@ -38,6 +39,7 @@ import org.apache.commons.lang3.function.Failable; import org.apache.commons.lang3.function.FailableConsumer; import org.apache.commons.lang3.function.FailablePredicate; +import org.apache.commons.lang3.stream.Streams.FailableStream; import org.junit.jupiter.api.DynamicTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestFactory; @@ -136,6 +138,13 @@ void testArrayCollectorCombiner() { assertEquals(Arrays.asList("a", "b", "c"), Streams.toArray(String.class).combiner().apply(left, Arrays.asList("b", "c"))); } + @Test + void testAssertNotTerminated() { + final FailableStream<String> stream = Streams.failableStream("A", "B"); + assertTrue(stream.allMatch(s -> s.length() == 1)); + assertThrows(IllegalStateException.class, () -> stream.allMatch(null)); + } + @SuppressWarnings("deprecation") @Test void testDeprefcatedCopnstructor() { @@ -233,6 +242,9 @@ void testOfEnumeration() { assertTrue(collect.contains("One")); assertTrue(collect.contains("Two")); assertEquals(2, collect.size()); + assertFalse(Streams.of(table.keys()).filter(String::isEmpty).findFirst().isPresent()); + assertEquals(Arrays.asList("OneOne", "TwoTwo"), Streams.of(table.keys()).map(s -> s + s).collect(Collectors.toList())); + assertFalse(Streams.of(new Hashtable<String, Object>().keys()).filter(String::isEmpty).findFirst().isPresent()); } @Test