Groovy web console

subscribe to the feed Subscribe
to this
site

Untitled

Published 1 month ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
List< Integer > emptyList = []
List< Integer > nullList = null
List<String> nullObjectList = [null]

if (emptyList?.size() > 0) {
    println "emptyList: truthy passed"
}

if (nullList?.size() > 0) {
    println "nullList: truthy passed"
}

if (nullObjectList?.size() > 0) {
    println "nullObjectList: truthy passed"
}