Java EnumSet is a specialized implementation of the Java Set interface that is designed for use with Java Enum types. It provides a highly efficient way to store a set of enum constants and is optimized for use with a small set of fixed, known values. Introduced in Java 2004 with Java 5, EnumSet is part of Java's java.util package and is a preferred alternative to Java HashSet when working with enum types.
https://docs.oracle.com/javase/8/docs/api/java/util/EnumSet.html