In C# when we wanna create methods that can take in lambda expressions as arguments we can use either Action
or Func<T>
depending on the situation. The new Java 8 has added support for lambdas but I couldn't find any decent example on how to use that. So assuming that I wanna create a method in Java similar to this C# one:
public static Boolean Check (String S, Func<String, Boolean> AnAction) {
return AnAction(S);
}
How exactly could this be written in Java then ?