copyOf
Creates an enum set with the same element type as the specified enum set, initially containing the same elements (if any).
Return
A copy of the specified enum set.
Parameters
s
the enum set from which to initialize this enum set
Throws
if s is null
Creates an enum set initialized from the specified collection. If the specified collection is an EnumSet instance, this static factory method behaves identically to .copyOf. Otherwise, the specified collection must contain at least one element (in order to determine the new enum set's element type).
Return
An enum set initialized from the given collection.
Parameters
c
the collection from which to initialize this enum set
Throws
if c is not an EnumSet instance and contains no elements
if c is null