PsiExpression (@Nullable PsiExpression expression, @NotNull BuilderType type) { if (expression instanceof PsiParenthesizedExpression parenthesizedExpression) { final PsiExpression next = parenthesizedExpression.getExpression(); return getFirstQualifier(next, type); } else if (expression instanceof PsiMethodCallExpression methodCallExpression) { final PsiReferenceExpression methodExpression = methodCallExpression.getMethodExpression(); final String name = methodExpression.getReferenceName(); if (name != null && returnSelfNames.get(type).contains(name)) { return getFirstQualifier(methodExpression.getQualifierExpression(), type); } } return expression; }