void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { if (!(element instanceof PsiMethodCallExpression countCall)) return; PsiElement countName = countCall.getMethodExpression().getReferenceNameElement(); if (countName == null) return; PsiMethodCallExpression qualifierCall = getQualifierMethodCall(countCall); switch (mySimplificationMode) { case SUM -> replaceFlatMap(countName, qualifierCall); case COLLECTION_SIZE -> replaceSimpleCount(countCall, qualifierCall); case ANY_MATCH -> replaceFilterCountComparison(qualifierCall, true); case NONE_MATCH -> replaceFilterCountComparison(qualifierCall, false); case IS_PRESENT -> replaceSimpleCountComparison(countCall, true); case NOT_IS_PRESENT, IS_EMPTY -> replaceSimpleCountComparison(countCall, false); } }