title: Best way to use Java8 streams to implement this collection
body: <pre><code>private enum EnumVals {
          FIRST(new String[]{"a","b"}),
          SECOND(new String[]{"a","b","c","d"}),
            THIRD(new String[]{"d","e"});
  
          private String[] vals;
  
          EnumVals(String[] q) {
              vals=q;
          }
  
          public String[] getValues(){
              return vals;
          }
      };
  </code></pre>
  
  <p>What I need is the unique combined list of all EnumVals.getValues().</p>
  
  <pre><code>String[] allVals = {"a","b","c","d","e"}
  </code></pre>
  
  <p>I did something like below, but it throws error :</p>
  
  <pre><code>Stream.of(EnumVals.values()).map(w-&gt;w.getValues()).collect(Collectors.toCollection(HashSet::new)).toArray(new String[0]);
  </code></pre>