public static @Nullable @Nls String validateEnumConstant(@NotNull PsiClass enumClass, @NonNls @Nullable String name) {
    if (!enumClass.isEnum() || name == null) return null;
    final Set<String> constantNames = CachedValuesManager.getCachedValue(enumClass, () ->
      CachedValueProvider.Result.create(Arrays.stream(enumClass.getFields())
                                          .filter(PsiEnumConstant.class::isInstance)
                                          .map(PsiField::getName)
                                          .map(StringUtil::toUpperCase)
                                          .collect(Collectors.toCollection(HashSet::new)),
                                        PsiModificationTracker.MODIFICATION_COUNT));
    if (!constantNames.contains(StringUtil.toUpperCase(name))) {
      return JavaFXBundle.message("enum.constant.not.found", name, enumClass.getQualifiedName());
    }
    return null;
  }
public static @Nullable @Nls String validateEnumConstant(@NotNull PsiClass enumClass, @NonNls @Nullable String name)