title: Is there a better way to get String[] from an Enum in Java?
body: <p>I have an enum </p>
  
  <pre><code>public enum UnitSystem {
      ImperialSystem("Imperial", "in.", 1),
      MetricSystem("Metric", "cm.", 2.54);
      private String unitSystemName;
      private String lengthSuffix;
      private double lengthCoeff;
  </code></pre>
  
  <p>I am trying to get <code>String[] l</code> that would have <code>{"Imperial", "Metric"};</code> that is an array containing <code>unitSystemName</code> of each system. Right now my best bet is:</p>
  
  <pre><code>String[] l = Arrays.stream(UnitSystem.values()).map(UnitSystem::name).collect(Collectors.toList()).toArray(new String[UnitSystem.values().length]);
  </code></pre>
  
  <p>Is there a better way to implement it?</p>