void () { @Language("JAVA") String text = """ class Foo { @Override int someMethod() { return 0; } int someOtherMethod( int param) { return 0; } }"""; configure(text); PsiClass fooClass = JavaPsiFacade.getInstance(getProject()).findClass("Foo", GlobalSearchScope.allScope(getProject())); FoldRegion[] regions = Stream.of(myFixture.getEditor().getFoldingModel().getAllFoldRegions()) .sorted(Comparator.comparingInt(reg -> reg.getStartOffset())).toArray(FoldRegion[]::new); assertEquals(3, regions.length); checkAccessorFolding(regions[0], regions[1], fooClass.getMethods()[0]); }