default List<RedUINode> getSubTree(Predicate<RedUINode> filter, boolean leavesFirst) {
        LinkedList<RedUINode> subTree = new LinkedList<>();
        Queue<RedUINode> queue = new LinkedList<>();
        queue.add(this);
        while (!queue.isEmpty()) {
            RedUINode next = queue.poll();
            if (filter.test(next)) {
                if (leavesFirst) { subTree.addFirst(next); } else { subTree.add(next); }
                queue.addAll(next.getOurChildren());
            }
        }
        return subTree;
    }
Builds a list of nodes in subtree rooted at this node, ignoring branches that do not pass
the filter. Filtered nodes are completely ignored, including all descendants.

@param filter      A predicate to filter branches
@param leavesFirst If true, subtree list will be sorted with leaves first rather than root
@return A subtree containing only nodes that pass the filter
core/src/main/java/mrtjp/projectred/redui/RedUINode.java