DummyRanker extends AbstractRanker { @Override public DecompoundedWord highestRank(ValueNode<DecompoundedWord> aParent, List<DecompoundedWord> aPath) { if (aPath != null) { aPath.add(aParent.getValue()); } List<DecompoundedWord> children = aParent.getChildrenValues(); if (children.size() == 0) { return aParent.getValue(); } return children.get(children.size() - 1); }  @Override DecompoundedWord highestRank(ValueNode<DecompoundedWord> aParent,
            List<DecompoundedWord> aPath);  }
@Test public void testRankTree() throws IOException { DummyRanker ranker = new DummyRanker(); DecompoundedWord s1 = DecompoundedWord.createFromString("Aktionsplan"); DecompoundedWord s2 = DecompoundedWord.createFromString("Akt+ion(s)+plan"); DecompoundedWord s3 = DecompoundedWord.createFromString("Aktion(s)+plan"); DecompoundingTree tree = new DecompoundingTree(s1); tree.getRoot().addChild(new ValueNode<DecompoundedWord>(s2)); tree.getRoot().addChild(new ValueNode<DecompoundedWord>(s3)); DecompoundedWord result = ranker.highestRank(tree); assertEquals(s3, result); }