boolean (PsiExpression expression) { if (!(expression instanceof PsiMethodCallExpression methodCallExpression)) { return false; } final PsiReferenceExpression methodExpression = methodCallExpression.getMethodExpression(); final String name = methodExpression.getReferenceName(); if (name == null || !creationMethodNameSet.contains(name)) { return false; } final PsiMethod method = methodCallExpression.resolveMethod(); if (method == null) { return false; } for (int i = 0; i < creationMethodName.length; i++) { if (!name.equals(creationMethodName[i])) { continue; } final PsiClass containingClass = method.getContainingClass(); final String expectedClassName = creationMethodClassName[i]; if (InheritanceUtil.isInheritor(containingClass, false, expectedClassName)) { return true; } } return false; }