void (final boolean showModules, final boolean showLibraryContents, boolean flattenPackages, boolean abbreviatePackageNames, @NonNls final String expected, final int levels) { final ProjectViewImpl projectView = (ProjectViewImpl)ProjectView.getInstance(myProject); projectView.setShowModules(PackageViewPane.ID, showModules); projectView.setShowLibraryContents(PackageViewPane.ID, showLibraryContents); projectView.setFlattenPackages(PackageViewPane.ID, flattenPackages); projectView.setAbbreviatePackageNames(PackageViewPane.ID, abbreviatePackageNames); projectView.setHideEmptyPackages(PackageViewPane.ID, true); PackageViewPane packageViewPane = new PackageViewPane(myProject) { @NotNull @Override protected ProjectAbstractTreeStructureBase createStructure() { ProjectAbstractTreeStructureBase structure = super.createStructure(); structure.setProviders(new ResourceBundleGrouper(myProject)); return structure; } }; packageViewPane.createComponent(); JTree tree = packageViewPane.getTree(); PlatformTestUtil.waitForPromise(TreeUtil.promiseExpand(tree, levels)); PlatformTestUtil.assertTreeEqual(tree, expected); BaseProjectViewTestCase.checkContainsMethod(packageViewPane.getTreeStructure().getRootElement(), packageViewPane.getTreeStructure()); Disposer.dispose(packageViewPane); }