I attempted to make a multiple line Predicate
by first adding curly brackets but Eclipse complains about the following code:
Stream<String> stringStream = temp.flatMap(x -> Arrays.stream(x));
Stream<String> stream = stringStream.filter(x -> {"a".equals(x.toString());});
It says after placing a red line under filter: "The method filter(Predicate<? super String>)
in the type Stream<String>
is not applicable for the arguments ((<no type> x) -> {})
"
Is this because multiline predicates are not allowed or am I making some other mistake?