Here you can find the source of of(E[] c)
public static <E extends Enum<E>> EnumSet<E> of(E[] c)
//package com.java2s; //License from project: Apache License import java.util.EnumSet; public class Main { public static <E extends Enum<E>> EnumSet<E> of(E[] c) { if (c.length == 0) { throw new IllegalArgumentException("Collection is empty"); }/*from ww w . j av a 2 s . com*/ EnumSet<E> result = EnumSet.of(c[0]); if (c.length > 1) { for (int i = 1; i < c.length; i++) { result.add(c[i]); } } return result; } }