# encoding: utf-8 emptyArray = $objectWrappers.wrap($arrays.arrayOf($plugins.loadClass("java.lang.Long"))) # 查找数组中的最大值,如果数组为空,则返回 nil maxValueOrNull = emptyArray.maxOfOrNull { |it| it } # 输出:最大值(或 nil): nil $console.log("最大值(或 nil): ", maxValueOrNull)