FunctionHelper (PsiType type, String instanceClassName) { return new FunctionHelper(type) { PsiExpression myExpression; @Override public PsiExpression getExpression() { return myExpression; } @Override public void transform(ChainContext context, String... argumentValues) { LOG.assertTrue(argumentValues.length == 0); myExpression = context.createExpression("new "+instanceClassName+"<>()"); } }; }