void () { DockManager dockManager = DockManager.getInstance(getProject()); VirtualFile file = getFile("/foo.txt"); manager.openFile(file, /* focusEditor = */ false); assertThat(dockManager.getContainers()).hasSize(1); manager.initDockableContentFactory(); manager.openFileInNewWindow(file); assertThat(dockManager.getContainers()).hasSize(2); Element context = new Element("context"); WorkingContextManager contextManager = WorkingContextManager.getInstance(getProject()); contextManager.saveContext(context); assertThat(context.getChild("editors").getChildren()).hasSize(2); assertThat(EditorFactory.getInstance().getAllEditors()).hasSize(2); contextManager.clearContext(); assertThat(dockManager.getContainers()).hasSize(1); assertThat(EditorFactory.getInstance().getAllEditors()).isEmpty(); }