def emptyArray = $objectWrappers.wrap($arrays.arrayOf($plugins.loadClass("java.lang.Integer"))) // 查找数组中的最大值,如果数组为空,则返回 null def maxValueOrNull = emptyArray.maxOfOrNull { it } // 输出:最大值(或 null): null $console.log("最大值(或 null): ", maxValueOrNull)