void () { myFoldingSettings.setCollapseAccessors(true); @Language("JAVA") String text = """ class Foo { private String bar; public Foo setBar(String bar) { this.bar = bar; return this; } }"""; configure(text); FoldingModelImpl foldingModel = (FoldingModelImpl)myFixture.getEditor().getFoldingModel(); int indexOfBar = text.indexOf("this.bar"); FoldRegion accessorStartFold = foldingModel.getCollapsedRegionAtOffset(indexOfBar); assertNotNull(accessorStartFold); assertFalse(accessorStartFold.isExpanded()); }