title: EnumSet from array, shortest variant?
body: <p>I need an <code>EnumSet</code> from an array (which is given through a varargs method parameter). First, I was surprised that there is no varargs constructor method in <code>EnumSet</code> (there is <code>EnumSet#of(E first, E... rest)</code>). As a workaround, I used the following variant:</p>
  
  <pre><code>EnumSet&lt;Options&gt; temp = EnumSet.copyOf(Arrays.asList(options));
  </code></pre>
  
  <p>However, this triggers a <code>java.lang.IllegalArgumentException: Collection is empty</code>. So, now I ended up with the following, which looks somewhat ridiculous:</p>
  
  <pre><code>EnumSet&lt;Options&gt; temp = options.length &gt; 0 ? 
                          EnumSet.copyOf(Arrays.asList(options)) : 
                          EnumSet.noneOf(Options.class);
  </code></pre>
  
  <p>If course this could be moved to some utility method, but still, I'm asking myself if there is a simpler way using existing methods?</p>