private static String @Nullable [] suggestProperlyCasedName(PsiElement psiElement) {
    if (!(psiElement instanceof PsiNamedElement)) return null;
    if (psiElement instanceof PsiFile) return null;
    String name = ((PsiNamedElement)psiElement).getName();
    if (name == null) return null;
    String prefix = "";
    if (psiElement instanceof PsiVariable) {
      final JavaCodeStyleManager codeStyleManager = JavaCodeStyleManager.getInstance(psiElement.getProject());
      final VariableKind kind = codeStyleManager.getVariableKind((PsiVariable)psiElement);
      prefix = codeStyleManager.getPrefixByVariableKind(kind);
      if (kind == VariableKind.STATIC_FINAL_FIELD) {
        final String[] words = NameUtilCore.splitNameIntoWords(name);
        String buffer = Arrays.stream(words).map(StringUtil::toUpperCase).collect(Collectors.joining("_"));
        return new String[] {buffer};
      }
    }
    final List<String> result = new ArrayList<>();
    result.add(suggestProperlyCasedName(prefix, NameUtilCore.splitNameIntoWords(name)));
    if (name.startsWith(prefix) && !prefix.isEmpty()) {
      name = name.substring(prefix.length());
      result.add(suggestProperlyCasedName(prefix, NameUtilCore.splitNameIntoWords(name)));
    }
    result.add(suggestProperlyCasedName(prefix, NameUtilCore.splitNameIntoWords(StringUtil.toLowerCase(name))));
    return ArrayUtilRt.toStringArray(result);
  }
private static String @Nullable [] suggestProperlyCasedName(PsiElement psiElement)