Lambda-Expression is a new feature in Java 1.8.
It is used to create an Expression, mostly for an Argument in a Method-Call, to implement a Functional Interface Method with a single line body.
There are also several functional interfaces given in the
java.util.function-Package.
Following Method is given by your Code:
private void callPredicate(
Predicate<String> value) {...}
Conventionally programmed Code calls the Method like:
callPredicate(
new Predicate<String>() {
@Override
public boolean test(String t) {
return t.indexOf("ll") >= 0;
}
});
With Lambda-Expressions you can abbreviate this call like:
callPredicate(t -> t.indexOf("ll") >= 0);