It's also very similar to the one in `HierarchyHandler`. Maybe the comparator should be available publicly (or PortalNode being `Comparable`?).