Supplier<PsiCodeBlock> (PsiElement context, String name) { if (name == null) return null; return () -> { PsiElementFactory factory = JavaPsiFacade.getElementFactory(context.getProject()); return factory.createCodeBlockFromText("{return \"" + StringUtil.escapeStringCharacters(name) + "\";}", context); }; }