[FLINK-1023] Switch group-at-a-time function to java.lang.Iterable (from java.util.Iterator)