UpdaterTreeNode extends DefaultMutableTreeNode implements Comparable<UpdaterTreeNode>, SdkUpdaterConfigPanel.MultiStateRow { @NotNull public String getStatusString() { return ""; }  abstract PackageNodeModel.SelectedState getInitialState(); abstract PackageNodeModel.SelectedState getCurrentState(); final void resetState(); boolean includeInSummary(); boolean isPrimary(); @Override final void cycleState(); @NotNull String getStatusString(); @Override int compareTo(@NotNull UpdaterTreeNode o); void customizeRenderer(Renderer renderer,
                                JTree tree,
                                boolean selected,
                                boolean expanded,
                                boolean leaf,
                                int row,
                                boolean hasFocus);  }
@Test public void testSummaryTreeNodeWithAndWithoutSources() throws Exception { DetailsTypes.PlatformDetailsType platformDetailsType = AndroidSdkHandler.getRepositoryModule().createLatestFactory() .createPlatformDetailsType(); FakePackage.FakeRemotePackage platformPackage = new FakePackage.FakeRemotePackage("platform"); FakePackage.FakeLocalPackage localPlatfromPackage = new FakePackage.FakeLocalPackage("platform"); platformPackage.setTypeDetails((TypeDetails)platformDetailsType); localPlatfromPackage.setTypeDetails((TypeDetails)platformDetailsType); UpdatablePackage updatablePlatformPackage = new UpdatablePackage(localPlatfromPackage, platformPackage); DetailsTreeNode platformNode = new DetailsTreeNode(new PackageNodeModel(updatablePlatformPackage), null, myConfigurable); Set<UpdaterTreeNode> nodes = ImmutableSet.of(platformNode); SummaryTreeNode node = SummaryTreeNode.createNode(new AndroidVersion(17, null), nodes); assertEquals("Installed", node.getStatusString()); DetailsTypes.SourceDetailsType sourceDetailsType = AndroidSdkHandler.getRepositoryModule().createLatestFactory() .createSourceDetailsType(); FakePackage.FakeRemotePackage sourcesPackage = new FakePackage.FakeRemotePackage("sources"); sourcesPackage.setTypeDetails((TypeDetails)sourceDetailsType); UpdatablePackage updatableSourcesPackage = new UpdatablePackage(sourcesPackage); DetailsTreeNode sourcesNode = new DetailsTreeNode(new PackageNodeModel(updatableSourcesPackage), null, myConfigurable); nodes = ImmutableSet.of(platformNode, sourcesNode); node = SummaryTreeNode.createNode(new AndroidVersion(17, null), nodes); assertEquals("Partially installed", node.getStatusString()); FakePackage.FakeLocalPackage localSourcesPackage = new FakePackage.FakeLocalPackage("sources"); localSourcesPackage.setTypeDetails((TypeDetails)sourceDetailsType); updatableSourcesPackage = new UpdatablePackage(localSourcesPackage, sourcesPackage); sourcesNode = new DetailsTreeNode(new PackageNodeModel(updatableSourcesPackage), null, myConfigurable); nodes = ImmutableSet.of(platformNode, sourcesNode); node = SummaryTreeNode.createNode(new AndroidVersion(17, null), nodes); assertEquals("Installed", node.getStatusString()); }