private static int verifyProperty5Helper(RBTreeNode<?, ?> node, int blackCount, int pathCount) {
        //If we're a black node, increment the count
        if (nodeColor(node) == Color.BLACK) {
            blackCount++;
        }
        //If we've hit a leaf node...
        if (node == null) {
            //...and there isn't a pathCount yet...
            if (pathCount == -1) {
                //...then record the count we just found.
                pathCount = blackCount;
            } else {
                //Otherwise (if we already have a pathCount), make sure our blackCount is equal.
                assert pathCount == blackCount;
            }
            //Finally, return the pathCount that we either just calculated, or had passed to us.
            return pathCount;
        }
        //For non-leaf nodes, recurse on children.
        pathCount = verifyProperty5Helper(node.left, blackCount, pathCount);
        pathCount = verifyProperty5Helper(node.right, blackCount, pathCount);
        //Again, return our calculated pathCount.
        return pathCount;
    }