Creates a <i>mutable</i> {@code TreeSet} instance containing the given elements sorted by their natural ordering.

@param elements the elements that the set should contain
@return a new {@code TreeSet} containing those elements (minus duplicates)
17392
public static <E extends Comparable<?>> TreeSet<E> newTreeSet(Iterable<? extends E> elements) {
		TreeSet<E> set = newTreeSet();
		for (E element : elements) {
			set.add(element);
		}
		return set;
	}
626921
public static <A> List<A> list(A... elements) {
        final List<A> list = new ArrayList<A>(elements.length);
        for (A element : elements) {
            list.add(element);
        }
        return list;
    }
1213970
public Set<SortedSet<T>> allSupersets(final SortedSet<T> set) {
        final Set<SortedSet<T>> supersets = new LinkedHashSet<>();
        allSupersets(set, this.rootNodes, supersets);
        return supersets;
    }
589881
public HllUpdate addAll(Collection<String> elements)
    {
        if (elements == null)
        {
            throw new IllegalArgumentException("Elements cannot be null");
        }

        for (String element : elements)
        {
            this.adds.add(BinaryValue.create(element));
        }

        return this;
    }
1206120
public static <E, S extends SortedSet<E>> UnmodifiableSortedSet<E> of(S set)
    {
        if (set == null)
        {
            throw new IllegalArgumentException("cannot create an UnmodifiableSortedSet for null");
        }
        return new UnmodifiableSortedSet<E>(SortedSetAdapter.adapt(set));
    }
921834
@SafeVarargs
    /* #end */
  public static <KType> KTypeArrayList<KType> from(KType... elements) {
    final KTypeArrayList<KType> list = new KTypeArrayList<KType>(elements.length);
    list.add(elements);
    return list;
  }
1110465
public Datatype.Builder addAllNestedClasses(Spliterator<? extends Excerpt> elements) {
    if ((elements.characteristics() & Spliterator.SIZED) != 0) {
      long elementsSize = elements.estimateSize();
      if (elementsSize > 0 && elementsSize <= Integer.MAX_VALUE) {
        if (nestedClasses instanceof ImmutableList) {
          nestedClasses = new ArrayList<>(nestedClasses);
        }
        ((ArrayList<?>) nestedClasses).ensureCapacity(nestedClasses.size() + (int) elementsSize);
      }
    }
    elements.forEachRemaining(this::addNestedClasses);
    return (Datatype.Builder) this;
  }
1125031
@SafeVarargs
	public static <E> ArrayList<E> newArrayList(E... elements) {
		ArrayList<E> list = new ArrayList<E>();
		Collections.addAll(list, elements);
		return list;
	}
805449
@SafeVarargs
  /* #end */
  public static <KType> KTypeHashSet<KType> from(KType... elements) {
    final KTypeHashSet<KType> set = new KTypeHashSet<KType>(elements.length);
    set.addAll(elements);
    return set;
  }
1342407
public static <E> HashSet<E> newHashSet(Iterator<? extends E> elements) {
		HashSet<E> set = newHashSet();
		while (elements.hasNext()) {
			set.add(elements.next());
		}
		return set;
	}
1173718
public static <F> FullList<F> newList(final F... elements) {
		final FullList<F> l = new FullList<F>(null, FullList.DEFAULT_CAPACITY);
		l.addAll(Arrays.asList(elements));
		return l;
	}
223141
public static <T> ArrayList<T> newArrayList(Iterable<T> elements) {
		return Lists.newArrayList(elements);
	}
81828
@SuppressWarnings("unchecked")
	public static <T> HashSet<T> newHashSet(T... elements) {
		return Sets.newHashSet(elements);
	}
638392
public static Set<ExecutableElement>
            methodsIn(Set<? extends Element> elements) {
        return setFilter(elements, METHOD_KIND, ExecutableElement.class);
    }
501174
public static <T> Set<T> copy(final Set<T> set) {
		if (set == null) {
			return null;
		}

		TypeEnum elementType = null;
		Set<T> copy = new HashSet<T>();
		for (T element : set) {
			T elementCopy = null;
			if (element != null) {
				if (elementType == null) {
					elementType = TypeEnum.dataTypeOf(element.getClass());
				}
				elementCopy = copy(element, elementType);
			}

			copy.add(elementCopy);
		}

		return copy;
	}
956958
private <T> List<T> immutableAdd(List<T> list, T element) {
      List<T> result = new ArrayList<T>(list);
      result.add(element);
      return Collections.unmodifiableList(result);
   }
1311255
public static <T> Set<T> immutableSetCopy(Set<T> set) {
      if (set == null) return null;
      if (set.isEmpty()) return Collections.emptySet();
      if (set.size() == 1) return Collections.singleton(set.iterator().next());
      Set<? extends T> copy = ObjectDuplicator.duplicateSet(set);
      if (copy == null)
         // Set uses Collection copy-ctor
         copy = attemptCopyConstructor(set, Collection.class);
      if (copy == null)
         copy = new HashSet<>(set);

      return new ImmutableSetWrapper<>(copy);
   }