void (@NotNull Project project, PsiElement element) { if (element instanceof PsiMethodCallExpression isPresentCall && isPresentCall.getMethodExpression().getQualifierExpression() instanceof PsiMethodCallExpression findCall && findCall.getMethodExpression().getQualifierExpression() instanceof PsiMethodCallExpression filterCall) { PsiElement replacement = element.replace(filterCall); PsiElementFactory factory = JavaPsiFacade.getElementFactory(project); PsiElement filterName = ((PsiMethodCallExpression)replacement).getMethodExpression().getReferenceNameElement(); LOG.assertTrue(filterName != null); filterName.replace(factory.createIdentifier(ANY_MATCH_METHOD)); } }