void (@NotNull Consumer<StructureViewModel> consumer) { myFixture.configureByFile(getTestName(false) + ".json"); final StructureViewBuilder builder = LanguageStructureViewBuilder.INSTANCE.getStructureViewBuilder(myFixture.getFile()); assertNotNull(builder); StructureViewComponent component = null; try { final FileEditor editor = FileEditorManager.getInstance(getProject()).getSelectedEditor(myFixture.getFile().getVirtualFile()); component = (StructureViewComponent)builder.createStructureView(editor, myFixture.getProject()); final StructureViewModel model = component.getTreeModel(); consumer.consume(model); } finally { if (component != null) { Disposer.dispose(component); } } }