code: public <T extends Enum<T>> T getEnum(Class<T> enumType, String key) {
      if (enumType == null) {
        throw new IllegalArgumentException("enumType may not be null");
      }
      Object value = get(key);
      if (enumType.isInstance(value)) {
        //noinspection unchecked
        return (T) value;
      } else if (value instanceof String) {
        String stringValue = (String) value;
        return Enum.valueOf(enumType, stringValue);
      }
      return null;
    }
docs: Returns the value mapped by {@code key} if it exists and is a enum or can be coerced to an
  enum. Returns null otherwise.