void () { configureFromFileText("a.java", """ class Foo { void bar() { Sy<caret>stem.out.println(); } }"""); JavaFoldingTestCase.performInitialFolding(getEditor()); List<AnAction> actions = SurroundWithHandler.buildSurroundActions(getProject(), getEditor(), getFile(), null); assertSize(2, ContainerUtil.findAll(actions, a -> { String text = a.getTemplatePresentation().getText(); return text != null && text.contains("while"); })); }