@Contract(value = "null -> false", pure = true)
  public static boolean isEnumType(PsiType type) {
    type = uncapture(type);
    if (type instanceof PsiClassType) {
      final PsiClass psiClass = ((PsiClassType)type).resolve();
      if (psiClass instanceof PsiTypeParameter) {
        return InheritanceUtil.isInheritor(psiClass, true, JAVA_LANG_ENUM);
      }
      return psiClass != null && psiClass.isEnum();
    }
    return false;
  }
@Contract(value = "null -> false", pure = true)
  public static boolean isEnumType(PsiType type)