public static <E extends Enum<E>>EnumSet<E> of(E e){
  EnumSet<E> set=EnumSet.noneOf(e.getDeclaringClass());
  set.add(e);
  return set;
}

public static < E extends Enum < E > > EnumSet < E > of ( E e ) { EnumSet < E > set = EnumSet . noneOf ( e . getDeclaringClass ( ) ) ; set . add ( e ) ; return set ; }
creates a new enum set , containing only the specified element . there are six overloadings of the method . they accept from one to five elements respectively . the sixth one receives an arbitrary number of elements , and runs slower than those that only receive a fixed number of elements .
