Java8:Effective use of Consumer Functional Interface

Java8:Effective use of Consumer Functional Interface
Java8 provides a functional interface called Consumer, Whose signature looks like following @FunctionalInterface public interface Consumer<T> {     void accept(T t);     default Consumer<T> andThen(Consumer<?...

Java8: deep dive to Supplier Interface

Java8: deep dive to Supplier  Interface
In this tutorial, we will learn How we can use a method reference as a Supplier and what we can do using this Supplier interface. Supplier: To put it simply we use the term  Supplier when it produces something. So in terms of java Supplier...