# encoding: utf-8 dw = $objectWrappers.wrap($iterables.mutableListOf()) numbers = $objectWrappers.wrap($arrays.arrayOf($plugins.loadClass("java.lang.Long"), 1, 2, 3, 4, 5)) # 将每个元素乘以 2, 翻倍后的数字: [2, 4, 6, 8, 10] numbers.mapTo(dw) { |it| it * 2 }.forEach { |it| $console.log(it) }