Convenience method to get the elements of a DataSet as a List.
As DataSet can contain a lot of data, this method should be used with caution.

@return A List containing the elements of the DataSet
772729
public List<T> collect() throws Exception {
		final String id = new AbstractID().toString();
		final TypeSerializer<T> serializer = getType().createSerializer(getExecutionEnvironment().getConfig());

		this.output(new Utils.CollectHelper<>(id, serializer)).name("collect()");
		JobExecutionResult res = getExecutionEnvironment().execute();

		ArrayList<byte[]> accResult = res.getAccumulatorResult(id);
		if (accResult != null) {
			try {
				return SerializedListAccumulator.deserializeList(accResult, serializer);
			} catch (ClassNotFoundException e) {
				throw new RuntimeException("Cannot find type class of collected data type.", e);
			} catch (IOException e) {
				throw new RuntimeException("Serialization error while deserializing collected data", e);
			}
		} else {
			throw new RuntimeException("The call to collect() could not retrieve the DataSet.");
		}
	}
622685
public static <T> List<T> toList(Iterable<T> iterable) {
        List<T> list = null;

        if (iterable != null) {
            list = new ArrayList<>();
            for (T elem : iterable) {
                list.add(elem);
            }
        }

        return list;
    }
1197718
public List<File> getFiles() {
        List<File> result = new LinkedList<File>();
        for (DataFile dataFile : dataFiles.values()) {
            result.add(dataFile.getFile());
        }
        return result;
    }
1016184
public List<T> getAll() {
		List<T> result = new ArrayList<T>();
		if (nodes != null)
			for(Node element : nodes) 
				result.add(getCachedOrNewRepresentation(element));
		return result;
	}
	
	public int size() {
		return nodes.size();
	}
	
	public T get(int index) {
		return getCachedOrNewRepresentation(nodes.get(index));
	}
		
	public Iterator<T> iterator() {
		return getAll().iterator();
	}
}
927288
final DataSet theEmptySet() {
    if (theEmptyOne == null) {
      theEmptyOne = new DataSet(this, EMPTY_ROW_LIST);
      theEmptyOne.setReadOnly();
    }
    return theEmptyOne;
  }
977615
@Nonnull
    public final ArrayList<A> toArrayList() {
        ArrayList<A> list = new ArrayList<>(this.length);
        ImmutableList<A> l = this;
        for (int i = 0; i < length; i++) {
            list.add(((NonEmptyImmutableList<A>) l).head);
            l = ((NonEmptyImmutableList<A>) l).tail;
        }
        return list;
    }
63416
public Iterator<DataPoint> getDataPointIterator()
    {
        Iterator<DataPoint> iteData = new Iterator<DataPoint>() 
        {
            int cur = 0;
            int to = size();

            @Override
            public boolean hasNext()
            {
                return cur < to;
            }

            @Override
            public DataPoint next()
            {
                return getDataPoint(cur++);
            }

            @Override
            public void remove()
            {
                throw new UnsupportedOperationException("This operation is not supported for DataSet");
            }
        };
        
        return iteData;
    }
943417
public static List<String> getLabels(Set dataSet) {
        char[] c = getLabelsArray(dataSet);
        List<String> l = new ArrayList<>(c.length);
        for (char c2 : c) {
            l.add(String.valueOf(c2));
        }
        return l;
    }
247066
public Collection<Part> getParts() throws IOException {
        if (!_parsed)
            parse();
        throwIfError();

        Collection<List<Part>> values = _parts.values();
        List<Part> parts = new ArrayList<>();
        for (List<Part> o : values) {
            List<Part> asList = LazyList.getList(o, false);
            parts.addAll(asList);
        }
        return parts;
    }
790880
public List<ColumnRelation> toList() {
        List<ColumnRelation> ret = new ArrayList<>();
        ret.add(this);
        if (getNextRelation().isPresent()) {
            ret.addAll(getNextRelation().get().toList());
        }
        return ret;
    }
313834
List<T> toList() {
    List<T> items = new ArrayList<>(data.length());
    for (int i = 0; i < data.length(); ++i) {
      T item = data.get(i);
      if (item != null) {
        items.add(item);
      }
    }
    return items;
  }
1090234
def get_elements(nodelist):
    

    element_list = []
    for node in nodelist:
        if node.nodeType == Node.ELEMENT_NODE:
            element_list.append(node)

    return element_list
869571
public List<Node<Scope>> toList() {
        List<Node<Scope>> list = new ArrayList<Node<Scope>>();
        walk(rootElement, list);
        return list;
    }
759150
@NonNull
    @Override
    public List<Object> toList() {
        final List<Object> array = new ArrayList<>();
        for (int i = 0; i < count(); i++) {
            array.add(values.get(i).asObject());
        }
        return array;
    }
357094
public String getDataset() {
    if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_dataset == null)
      jcasType.jcas.throwFeatMissing("dataset", "edu.cmu.lti.oaqa.framework.types.InputElement");
    return jcasType.ll_cas.ll_getStringValue(addr, ((InputElement_Type)jcasType).casFeatCode_dataset);}
664069
public List<T> nextPermutationAsList()
    {
        List<T> permutation = new ArrayList<T>(elements.length);
        return nextPermutationAsList(permutation);
    }
1287530
public static Collector<Quad, ?, Dataset> toDataset() {
        return of(rdf::createDataset, Dataset::add, (left, right) -> {
            right.iterate().forEach(left::add);
            return left;
        }, UNORDERED);
    }