boolean (PsiReferenceExpression otherRef, PsiExpression expression) { expression = PsiUtil.skipParenthesizedExprDown(expression); if(expression instanceof PsiPolyadicExpression polyadicExpression) { if (polyadicExpression.getOperationTokenType().equals(JavaTokenType.PLUS)) { for (PsiExpression operand : polyadicExpression.getOperands()) { if (isSameReference(operand, otherRef) || isAppended(otherRef, operand)) return true; } } } return false; }