Groovy Declarative Style Code [1,2,3,4,5].findAll { it % 2 == 0 }.each() {value->println "${value*2}"}; There are lot of way to address this stuff in Java 8. So let’s have a look to do the same stuff in Java 8 Example:- import java.util.Arrays ; import java.util.List ; class DeclarativeStyle { public static void main(String []args){ List numbers = Arrays.asList(1,2,3,4, 5, 6); numbers.stream() //A Fancy Collection .filter(DeclarativeStyle::isEven) //Filter the data .map(DeclarativeStyle::doubleInteger) //Map new values .forEach( System.out::println ); //Iterate & perform the operation } public static String doubleInteger(Integer number){ return String.valueOf(number * 2); } public static Boolean isEven(Integer number){ return number%2==0; } } The first three method calls are just lazy ca