class SortingHierarchicalCollections {

    public List<T> sortFromLeafToRoot(Collection<T> elements) throws CycleDetectedException {
        return Lists.reverse(sortFromRootToLeaf(elements));
    }

    public  SortingHierarchicalCollections(Function<T, IdT> index,
                                  Function<T, Optional<IdT>> parentId);

}