code: public static <E extends Enum<E>> EnumSet<E> copyOf(Collection<E> c) {
          if (c instanceof EnumSet) {
              return ((EnumSet<E>)c).clone();
          } else {
              if (c.isEmpty())
                  throw new IllegalArgumentException("Collection is empty");
              Iterator<E> i = c.iterator();
              E first = i.next();
              // J2ObjC modification - This check is implicit in the JVM but not with J2ObjC.
              if (!(first instanceof Enum)) {
                // Violates method's generic signature.
                throw new ClassCastException();
              }
              EnumSet<E> result = EnumSet.of(first);
              while (i.hasNext())
                  result.add(i.next());
              return result;
          }
      }
docs: Creates an enum set initialized from the specified collection.  If
  the specified collection is an <tt>EnumSet</tt> instance, this static
  factory method behaves identically to {@link #copyOf(EnumSet)}.
  Otherwise, the specified collection must contain at least one element
  (in order to determine the new enum set's element type).
  
  @param <E> The class of the elements in the collection
  @param c the collection from which to initialize this enum set
  @return An enum set initialized from the given collection.
  @throws IllegalArgumentException if <tt>c</tt> is not an
  <tt>EnumSet</tt> instance and contains no elements
  @throws NullPointerException if <tt>c</tt> is null