xxxxxxxxxx
The Functions that return another Function is called Higher Order Functions, and applying these functions one by one like Fluid Operations are called Functional Composition
Let's understand this with an Example -
Look at this code closely this is returning a Function, so this can be called as Higher Order Function.
public static Comparator<String> reverse(Comparator<String> comp) {
return (x, y) -> comp.compare(y, x);
}