List<String> (@NotNull PsiQualifiedReferenceElement ref) { Collection<String> fqns = getFqns(ref); List<String> res = new ArrayList<>(fqns.size()); for (String fqn : fqns) { if (fqn.startsWith("java.") || fqn.startsWith("javax.swing.")) { continue; } int index = fqn.lastIndexOf('.'); if (index == -1) { continue; } String className = fqn.substring(index + 1); if (className.isEmpty() || Character.isLowerCase(className.charAt(0))) { continue; } res.add(fqn); } return res; }