title: What is a good way to get ENUM values from a ENUM representing some Weekdays
body: <p>I have an <code>ENUM</code> with only 3 constant. Based on flag, named <code>weekend</code>, ENUM.values() should return either 3 or 2 constants.</p>
  <pre><code>public enum Weekday { 
      SUNDAY, MONDAY, TUESDAY;
  }
  
  public Weekday[] getDays() {
      boolean weekend = true;
      if (weekend){
          return Weekday.values() // this will reurn SUNDAY, MONDAY, TUESDAY
      } else { // when weekend is false
           return Weekday.values() // it should return on MONDAY, TUESDAY
        }
  }
  </code></pre>
  <p>Please suggest, what is the a reasonable good approach to achieve this. I am able to achieve it with the below code. Unfortunately, the PR reviewer does not seem to be happy this that. Could you suggest a better approach?</p>
  <p>My solution.</p>
  <pre><code> EnumMap&lt;Weekday, Integer&gt; days= new EnumMap&lt;&gt;(Weekday.class);
      days.put(Weekday.MONDAY, 1);
      days.put(Weekday.TUESDAY, 2);
  
      return days.keySet().toArray(new Weekday[0]); // this returns MONDAY and TUESDAY.
  </code></pre>