This may be sufficient in many cases
stream.findAny().isPresent()
More Related Contents:
- Is there a concise way to iterate over a stream with indices in Java 8?
- How to ensure order of processing in java8 streams?
- Convert Iterable to Stream using Java 8 JDK
- Using Java 8’s Optional with Stream::flatMap
- Java 8 Streams: multiple filters vs. complex condition
- Java 8 stream reverse order
- Partition a Java 8 Stream
- Java 8’s streams: why parallel stream is slower?
- Stream and lazy evaluation
- Adding up BigDecimals using Streams
- How do I keep the iteration order of a List when using Collections.toMap() on a stream?
- Why is this java Stream operated upon twice?
- Java 8 Streams – collect vs reduce
- How can I get a List from some class properties with Java 8 Stream?
- Is it possible to use the Java 8 Stream API on Android API < 24?
- Why doesn’t java.util.Collection implement the new Stream interface?
- Stream Filter of 1 list based on another list
- How do I create a Stream of regex matches?
- Simplest way to print an `IntStream` as a `String`
- Iterate two Java-8-Streams together [duplicate]
- Grouping by object value, counting and then setting group key by maximum object attribute
- Why parallel stream get collected sequentially in Java 8
- In Stream reduce method, must the identity always be 0 for sum and 1 for multiplication?
- How to group objects when each object could go in multiple groups?
- How to implement a Java stream?
- Why didn’t Stream have a toList() method?
- In Java 8 how do I transform a Map to another Map using a lambda?
- Does collect operation on Stream close the stream and underlying resources?
- How to get multiple values from an object using a single stream operation?
- non-interference requirement on Java 8 streams