local numbers = _objectWrappers:wrap(_arrays:arrayOf(_plugins:loadClass("java.lang.Integer"), 10, 20)) -- 尝试获取数组中唯一的元素,如果数组不包含唯一元素,则返回 nil local singleElementOrNull = numbers:singleOrNull(function() return true end) -- 输出:唯一的元素(或 nil): nil _console:log("唯一的元素(或 nil): ", singleElementOrNull)