SliceTreeStructure (@NonNls String name) { myFixture.configureByFile(name + ".java"); PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); PsiElement element = SliceHandler.create(true).getExpressionAtCaret(getEditor(), getFile()); assertNotNull(element); Collection<HighlightInfo> errors = myFixture.doHighlighting(HighlightSeverity.ERROR); assertEmpty(errors); SliceAnalysisParams params = new SliceAnalysisParams(); params.scope = new AnalysisScope(getProject()); params.dataFlowToThis = true; SliceUsage usage = LanguageSlicing.getProvider(element).createRootUsage(element, params); ToolWindowHeadlessManagerImpl.MockToolWindow toolWindow = new ToolWindowHeadlessManagerImpl.MockToolWindow(getProject()); SlicePanel panel = new SlicePanel(getProject(), true, new SliceRootNode(getProject(), new DuplicateMap(), usage), false, toolWindow) { @Override public boolean isAutoScroll() { return false; } @Override public void setAutoScroll(boolean autoScroll) { } @Override public boolean isPreview() { return false; } @Override public void setPreview(boolean preview) { } }; Disposer.register(getProject(), panel); return panel.getBuilder().getTreeStructure(); }