That creates unnecessary overhead. HashSets use hash tables and object headers. Use EnumSet instead. It uses a bit vector internally. It is extremely fast and uses almost no memory. It is perfect for ...
A set of Java annotations which can be used in JVM-based languages. They serve as an additional documentation and can be interpreted by IDEs and static analysis tools to improve code analysis.