public static <T> List<T> asList(Iterator<T> it) {
		List<T> list = new ArrayList<>();
		if (it == null) {
			return list;
		}

		while (it.hasNext()) {
			T t = it.next();
			list.add(t);
		}
		return list;
	}
Returns the given collection if not null, an empty collection otherwise.  This is
useful for clients avoid null checks.

@param c the collection to check
@return a non-null collection
Ghidra/Framework/Generic/src/main/java/util/CollectionUtils.java