JavaMethodCallElement (boolean shouldImport, List<? extends PsiMethod> members) { PsiMethod method = members.get(0); boolean shouldImportOrQualify = true; boolean shouldShowClass = true; if (myOriginalPosition != null && PsiTreeUtil.isAncestor(method.getContainingClass(), myOriginalPosition, true)) { shouldImportOrQualify = false; shouldShowClass = false; } if (myOriginalPosition != null && ImportsUtil.hasStaticImportOn(myOriginalPosition, method, true)) { PsiClass psiClass = PsiTreeUtil.getParentOfType(myOriginalPosition, PsiClass.class); if (psiClass != null && !PsiTreeUtil.isAncestor(psiClass, method, true) && !ContainerUtil.and(psiClass.getAllMethods(), containingMethod -> method.getName().equals(containingMethod.getName()))) { shouldImportOrQualify = false; } } return new JavaQualifierAsParameterMethodCallElement(members.stream().filter(t -> filter(t)).toList(), myOldQualifiedExpression, shouldImport, shouldImportOrQualify, shouldShowClass, isSmart); }