code: public static <T extends Enum<?>> T[] getValues(Class<T> clazz) {
          Method m;
          
          try {
              m = clazz.getDeclaredMethod("values");
          } catch (SecurityException | NoSuchMethodException e) {
              throw new RuntimeException(e);
          }
          m.setAccessible(true);
          try {
              return (T[]) m.invoke(null);
          } catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException e) {
              throw new RuntimeException(e);
          }
      }
docs: --