foreEach in the library takes a Consumer Interface implementation as argument. The problem is that the implementation of Consumer Interface is an anonymous class and is clumsy.
pointList.forEach(new Consumer<Point>() {
public void accept(Point p) {
p.move(p.y, p.x);
}
});
lambdas make things so simply
pointList.forEach(p -> p.move(p.y, p.x));
code snippets and ideas taken from Maurice’s blog post