void () { JavaCodeFoldingSettings foldingSettings = JavaCodeFoldingSettings.getInstance(); boolean collapseMethods = foldingSettings.isCollapseMethods(); boolean i18nMessages = foldingSettings.isCollapseI18nMessages(); try { foldingSettings.setCollapseMethods(false); foldingSettings.setCollapseI18nMessages(true); myFixture.copyFileToProject("i18n.properties"); PsiFile file = myFixture.configureByFile("MyClass1.java"); List<FoldingUpdate.RegionInfo> foldings = FoldingUpdate.getFoldingsFor(file, false); assertFalse(foldings.stream().map(info -> info.descriptor).anyMatch(descriptor -> descriptor.getPlaceholderText().equals("\"Welcome\""))); } finally { foldingSettings.setCollapseMethods(collapseMethods); foldingSettings.setCollapseI18nMessages(i18nMessages); } }