What is Groovy Truth Groovy has its own way of defining what is true and what is false, this is called the Groovy Truth . In Java, we have to write statements like if(obj ==null) , in groovy you can simply write if(obj) and you can define in what conditions this object will evaluate to true and when it will evaluate to false. Info To define your custom logic for groovy Truth you need to define method boolean asBoolean(){ // your logic here } What is True in Groovy Following evaluated to true in groovy boolean true Not null objects Non 0 numbers Not null and not empty Strings Not null and not empty lists, maps, collections What is False in Groovy Following things evaluates to false in groovy boolean false Numeric 0 number Null objects Null Strings Null or empty lists, maps, collections def groovyTruth = {val-> if (val) println "$val is true" else println "$val is false" } boolean b1 = true boolean b2 = false groovyTruth(b1) // true groovyTru...