def numbers = $objectWrappers.wrap($arrays.arrayOf($plugins.loadClass("java.lang.Integer"), 2, 4, 6, 8, 10)) def names = $objectWrappers.wrap($arrays.arrayOf($plugins.loadClass("java.lang.String"), "Alice", "Bob", "Charlie")) // 检查 numbers 数组中的所有元素是否都是偶数 def allEven = numbers.all { it % 2 == 0 } $console.log("numbers 数组中的所有元素都是偶数吗:", allEven) // 输出:true // 检查 names 数组中的所有元素是否都包含字母 "a" def allContainA = names.all { $objectWrappers.wrap(it).contains((char) 'a') } $console.log("names 数组中的所有元素都包含字母 \"a\" 吗:", allContainA) // 输出:false