default List<RedUINode> getZOrderedSubtree(Predicate<RedUINode> filter, boolean reversed) {
        List<RedUINode> subTree = getSubTree(filter, !reversed);
        subTree.sort(Comparator.comparingDouble(n -> n.getZPosition() * (reversed ? 1 : -1)));
        return subTree;
    }
Builds a subtree list with nodes sorted in ascending or descending z order. Nodes at the front
of the list will have a larger Z position and should be rendered on top.
<p>
Nodes with equal Z positions will be ordered based on their location in the tree,
with nodes further from the root receiving priority.

@param filter   Subtree branch filter
@param reversed If true, sort in ascending z order
@return Subtree in descending z position order
core/src/main/java/mrtjp/projectred/redui/RedUINode.java