class DiametricCommon {
IRubyObject collect(ThreadContext context, Block block, Iterator<Object> itr) {
RubyArray ary = context.getRuntime().newArray();
while (itr.hasNext()) {
IRubyObject next = DiametricUtils.convertJavaToRuby(context, itr.next());
ary.callMethod(context, "<<", block.yield(context, next));
}
return ary;
}
IRubyObject count(ThreadContext context, IRubyObject arg, Object target) {