IntermediateOperation (@NotNull String name, PsiExpression @NotNull [] args) { if (args.length != 1) return null; if (name.equals("map")) { FunctionHelper fn = FunctionHelper.create(args[0], 1); return fn == null ? null : new Map(fn); } if (name.equals("filter")) { FunctionHelper fn = FunctionHelper.create(args[0], 1); return fn == null ? null : new Filter(fn); } if (name.equals("or")) { FunctionHelper fn = FunctionHelper.create(args[0], 0); return fn == null ? null : Or.create(fn); } if (name.equals("flatMap")) { FunctionHelper fn = FunctionHelper.create(args[0], 1); return fn == null ? null : FlatMap.create(fn); } return null; }