Lets say I have a Stream of Strings.
final Stream<String> stream = ...;
I want to filter out each empty string after trimmed.
stream
.filter(Objects::nonNull)
.map(String::trim)
.filter(v -> !v.isEmpty());
Is there any way to apply Predicate#negate() for replacing v -> !v.isEmpty()
part?
.filter(((Predicate) String::isEmpty).negate()) // not compile