void () { Document document = configureFromFileText("foo.txt", "\n"); BookmarksManager bookmarksManager = BookmarksManager.getInstance(getProject()); bookmarksManager.add(LineBookmarkProvider.Util.find(getProject()).createBookmark(getVFile(), 0), BookmarkType.DEFAULT); assertEquals(1, bookmarksManager.getBookmarks().size()); Element element = new Element("foo"); WorkingContextManager contextManager = WorkingContextManager.getInstance(getProject()); contextManager.saveContext(element); contextManager.clearContext(); PlatformTestUtil.waitForAlarm(50); assertEquals(0, bookmarksManager.getBookmarks().size()); contextManager.loadContext(element); PlatformTestUtil.waitForAlarm(50); assertEquals(1, bookmarksManager.getBookmarks().size()); }