# encoding: utf-8 numbers = $objectWrappers.wrap($arrays.arrayOf($plugins.loadClass("java.lang.Object"), $arrays.arrayOf($plugins.loadClass("java.lang.Long"), 1, 2), $arrays.arrayOf($plugins.loadClass("java.lang.Long"), 3, 4), $arrays.arrayOf($plugins.loadClass("java.lang.Long"), 5, 6))) # 将嵌套数组展平为单个列表,展平后的列表: [1, 2, 3, 4, 5, 6] numbers.flatMap { |it| $arrays.toList(it) }.forEach { |it| $console.log(it) }