public static class NonEmptySet.Companion
@JvmStatic @NotNull public <T> NonEmptySet<T> of(T element)
Returns a singleton set containing element
. This behaves the same as Collections.singleton but returns a
class NonEmptySet
for the extra type-safety.
element
,
Collections.singleton,
class NonEmptySet
@JvmStatic @NotNull public <T> NonEmptySet<T> of(T first, T second, @NotNull T... rest)
Returns a non-empty set containing the given elements, minus duplicates, in the order each was specified.
@JvmStatic @NotNull public <T> NonEmptySet<T> copyOf(@NotNull java.util.Collection<? extends T> elements)
Returns a non-empty set containing each of elements
, minus duplicates, in the order each appears first in
the source collection.