PsiExpression (String pipelineHead, String elementText, String lambdaExpression, String pipelineTail, Project project) { final StringBuilder sb = new StringBuilder(); sb.append(pipelineHead).append(".").append(elementText); if (lambdaExpression != null) { sb.append("(").append(lambdaExpression).append(")"); } if (pipelineTail != null) { sb.append(".").append(pipelineTail); } return JavaPsiFacade.getElementFactory(project).createExpressionFromText(sb.toString(), null); }