LookupElement (@NotNull PsiMethod method, @NotNull PsiClass containingClass, boolean shouldImport) { List<PsiMethod> overloads = ContainerUtil.findAll(containingClass.findMethodsByName(method.getName(), true), this::isStaticallyImportable); assert !overloads.isEmpty(); if (overloads.size() == 1) { assert method == overloads.get(0); return createLookupElement(method, containingClass, shouldImport); } if (overloads.get(0).getParameterList().isEmpty()) { overloads = new ArrayList<>(overloads); ContainerUtil.swapElements(overloads, 0, 1); } return createLookupElement(overloads, containingClass, shouldImport); }