HOMERNode extends AbstractMultiLabelClassifier { public Collection<Integer> getLabels() { Collection<Integer> labels = new HashSet<>(); this.children.stream().map(HOMERNode::getLabels).forEach(labels::addAll); return labels; } HOMERNode(final HOMERNode... nodes);  HOMERNode(final List<HOMERNode> nodes); void setThreshold(final boolean doThreshold); void setBaselearner(final MultiLabelClassifier baselearner); String getBaselearnerName(); void setBaselearnerName(final String baselearnerName); List<HOMERNode> getChildren(); Collection<Integer> getLabels(); @Override void buildClassifier(final Instances trainingSet); @Override double[] distributionForInstance(final Instance testInstance); Instances prepareInstances(final Instances dataset); boolean isLeaf(); @Override String toString();  }
@Test public void testGetLabels() { assertTrue("Node does not contain all labels", node.getLabels().containsAll(Arrays.asList(1, 2, 5))); }