public List<List<Object>> apply(final Iterator<?> iterator) {
            final List<List<Object>> list = new ArrayList<>();
            int i = 0;
            while (iterator.hasNext()) {
                list.add(Arrays.asList(iterator.next(), i++));
            }
            return Collections.unmodifiableList(list);
        }
Type of the index as it corresponds to the associated {@link WithOptions#list} and {@link WithOptions#map}.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/IndexStep.java