I am messing around with Java 8 lambda and I was trying to do the following but apparently I am doing something very wrong. I have an array of string String [] q and I was trying to call a static method that returns a set of Node objects for each element in the array.
Here is what I wrote:
Set<Set<Node>> sets = Arrays.asList(q).stream().forEach(InMemoryGraph::getAllPredicates);
getAllPredicates is a method that accepts a String as an argument and returns a Set<Node>
Do I need to use java.util.function? Any suggestion is appreciated.
getAllPredicatesis a static method, right?