boolean (PsiVariable variable) { final PsiExpression initializer = variable.getInitializer(); if (initializer != null && !ExpressionUtils.nonStructuralChildren(initializer) .allMatch(MismatchedCollectionQueryUpdateInspection::isEmptyCollectionInitializer)) { return true; } if (initializer instanceof PsiNewExpression newExpression) { final PsiAnonymousClass anonymousClass = newExpression.getAnonymousClass(); if (anonymousClass != null) { if (getCollectionQueryUpdateInfo(null, anonymousClass, queryNames, updateNames).updated) { return true; } final ThisPassedAsArgumentVisitor visitor = new ThisPassedAsArgumentVisitor(); anonymousClass.accept(visitor); if (visitor.isPassed()) { return true; } } } return false; }