import java.util.EnumSet;
import java.util.Set;

enum Months {
    JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
}

public class HelloEnumSet {
    public static void main(String... args) {
        System.out.println("Hello EnumSet!");

        Set<Months> empty = EnumSet.noneOf(Months.class);

        Set<Months> yr = EnumSet.allOf(Months.class);

        EnumSet<Months> h1 = EnumSet.range(Months.JAN, Months.JUN);

        Set<Months> h2 = EnumSet.complementOf(h1);

        Set<Months> q1 = EnumSet.of(Months.JAN, Months.FEB, Months.MAR);
        Set<Months> q2 = EnumSet.of(Months.APR, Months.MAY, Months.JUN);
        Set<Months> q3 = EnumSet.of(Months.JUL, Months.AUG, Months.SEP);
        Set<Months> q4 = EnumSet.of(Months.OCT, Months.NOV, Months.DEC);

        boolean containsFeb = h2.contains(Months.FEB);

        Set<Months> yr02 = EnumSet.copyOf(yr);
        yr02.remove(Months.FEB);

        Set<Months> customYr = EnumSet.noneOf(Months.class);
        customYr.add(Months.MAY);
        customYr.add(Months.JUN);
        customYr.add(Months.JUL);

        System.out.println("Empty: " + empty);
        System.out.println("Year: " + yr);
        System.out.println("First Half of Year: " + h1);
        System.out.println("Second Half of Year: " + h2);
        System.out.printf("Second Half contains FEB = %b\n", containsFeb);
        System.out.println("Year without FEB: " + yr02);
        System.out.println("Custom Year: " + customYr);

        System.out.println("Q1: " + q1);
        System.out.println("Q2: " + q2);
        System.out.println("Q3: " + q3);
        System.out.println("Q4: " + q4);

        int yrSize = yr.size();
        int h1Size = h1.size();
        int q1Size = q1.size();
        int yr2Size = yr02.size();

        System.out.printf("Sizes: yr = %s, h1 = %s, Q1 = %s, Year without FEB = %s\n", yrSize, h1Size, q1Size, yr2Size);
    }
}

@@ -40,89 +40,45 @@
 til.
-Set;%0A%0Aenum Months %7B%0A    JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DE
+Iterator;%0A%0Aenum Alphabet %7B%0A    A, B, 
 C%0A%7D%0A
@@ -103,16 +103,25 @@
 oEnumSet
+Iteration
  %7B%0A    p
@@ -202,16 +202,26 @@
  EnumSet
+ Iteration
 !%22);%0A%0A  
@@ -230,1231 +230,722 @@
     
-Set%3CMonths%3E empty = EnumSet.noneOf(Months.class);%0A%0A        Set%3CMonths%3E yr = EnumSet.allOf(Months.class);%0A%0A        EnumSet%3CMonths%3E h1 = EnumSet.range(Months.JAN, Months.JUN);%0A%0A        Set%3CMonths%3E h2 = EnumSet.complementOf(h1);%0A%0A        Set%3CMonths%3E q1 = EnumSet.of(Months.JAN, Months.FEB, Months.MAR);%0A        Set%3CMonths%3E q2 = EnumSet.of(Months.APR, Months.MAY, Months.JUN);%0A        Set%3CMonths%3E q3 = EnumSet.of(Months.JUL, Months.AUG, Months.SEP);%0A        Set%3CMonths%3E q4 = EnumSet.of(Months.OCT, Months.NOV, Months.DEC);%0A%0A        boolean containsFeb = h2.contains(Months.FEB);%0A%0A        Set%3CMonths%3E yr02 = EnumSet.copyOf(yr);%0A        yr02.remove(Months.FEB);%0A%0A        Set%3CMonths%3E customYr = EnumSet.noneOf(Months.class);%0A        customYr.add(Months.MAY);%0A        customYr.add(Months.JUN);%0A        customYr.add(Months.JUL);%0A%0A        System.out.println(%22Empty: %22 + empty);%0A        System.out.println(%22Year: %22 + yr);%0A        System.out.println(%22First Half of Year: %22 + h1);%0A        System.out.println(%22Second Half of Year: %22 + h2);%0A        System.out.printf(%22Second Half contains FEB = %25b%5Cn%22, containsFeb);%0A        System.out.println(%22Year without FEB: %22 + yr02);%0A        System.out.println(%22Custom Year: %22 + customYr);%0A%0A        
+EnumSet%3CAlphabet%3E eSet = EnumSet.of(Alphabet.A, Alphabet.B, Alphabet.C);%0A%0A        System.out.println(%22Iterator%3CAlphabet%3E it = eSet.iterator(); while (it.hasNext()) %7B...%22);%0A        Iterator%3CAlphabet%3E it = eSet.iterator();%0A        while (it.hasNext()) %7B%0A            System.out.println(it.next());%0A        %7D%0A%0A        System.out.println(%22for(Alphabet s : Alphabet.values()) %7B...%22);%0A        for (Alphabet s : Alphabet.values()) %7B%0A            System.out.println(s);%0A        %7D%0A%0A        System.out.println(%22for (final Alphabet s : EnumSet.allOf(Alphabet.class)) %7B...%22);%0A        for (final Alphabet s : EnumSet.allOf(Alphabet.class)) %7B%0A            System.out.println(s);%0A        %7D%0A%0A        System.out.println(%22eSet.forEach(
 Syst
@@ -954,39 +954,44 @@
 .out
-.
+::
 println
-(%22Q1: %22 + q1);%0A        
+);%22);%0A        eSet.forEach(
 Syst
@@ -1000,31 +1000,21 @@
 .out
-.
+::
 println
-(%22Q2: %22 + q2
 );%0A
+%0A
     
@@ -1041,29 +1041,45 @@
 ln(%22
-Q3: %22 + q3);%0A        
+Stream.of(Alphabet.values()).forEach(
 Syst
@@ -1088,172 +1088,53 @@
 .out
-.
+::
 println
-(%22Q4: %22 + q4);%0A%0A        int yrSize = yr.size();%0A        int h1Size = h1.size();%0A        int q1Size = q1.size();%0A        int yr2Size = yr02.size();%0A%0A        
+);%22);%0A        eSet.stream().forEach(
 Syst
@@ -1143,108 +1143,17 @@
 .out
-.
+::
 print
-f(%22Sizes: yr = %25s, h1 = %25s, Q1 = %25s, Year without FEB = %25s%5Cn%22, yrSize, h1Size, q1Size, yr2Size
+ln
 );%0A 

Update HelloEnumSet.java