In Java 8, the lambda expression is a replacement for an anonymous inner class that implements a functional interface. It looks like you use Predicatebecause expression boolean.
PredicateInterface was introduced in Java 8 , so you need to recreate it yourself. You cannot create methods defaultor static, therefore, just use the functional interface method.
public interface Predicate<T>
{
public boolean test(T t);
}
- .
System.out.println(nicksGraph.findPath(
nicksGraph.nodeWith(new Coordinate(0,0)),
new Predicate<Coordinate>() {
@Override
public boolean test(Coordinate a) {
return a.getX()==3 && a.getY()==1;
}
},
new PriorityQueue<Node<Coordinate>, Integer>(funcTotal)));