public static boolean isRestrictedStaticEnumField(@NotNull PsiField field, @NotNull PsiClass enumClass) {
    if (!field.hasModifierProperty(PsiModifier.STATIC)) return false;
    if (field.getContainingClass() != enumClass) return false;

    if (!JavaVersionService.getInstance().isAtLeast(field, JavaSdkVersion.JDK_1_6)) {
      PsiType type = field.getType();
      if (type instanceof PsiClassType && ((PsiClassType)type).resolve() == enumClass) return false;
    }

    return !PsiUtil.isCompileTimeConstant(field);
  }
public static boolean isRestrictedStaticEnumField(@NotNull PsiField field, @NotNull PsiClass enumClass)