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 ...