I came across this problem that I without knowing the actual enum type I need to iterate its possible values.
enum
if (value instanceof Enum){ Enu
One can also use the java.util.EnumSet like this
@Test void test(){ Enum aEnum =DayOfWeek.MONDAY; printAll(aEnum); } void printAll(Enum value){ Set allValues = EnumSet.allOf(value.getClass()); System.out.println(allValues); }