As an expression
(Person p) -> p.getGender() == Person.Sex.MALE
&& p.getAge() >= 18
&& p.getAge() <= 25
As a local variable
// imports a couple of java tasks | |
apply plugin: "java" | |
// List available tasks in the shell | |
> gradle tasks | |
// A Closure that configures the sourceSets Task | |
// Sets the main folder as Source folder (where the compiler is looking up the .java files) | |
sourceSets { | |
main.java.srcDir "src/main" |