Decorator Design Pattern With Lambdas

Today let’s try to implement Decorator design pattern with the help of Java Lambda expressions.

Photo by Marvin Meyer on Unsplash
public static void printit(int n, String msg, Function<Integer, Integer> func){
System.out.println(n+" " + msg+" : "+func.apply(n));
}