public RBNode search(int i) {
            if (isNil()) {
                return null;
            } else if (getKey() == i) {
                comparisonsDel++;
                return this;
            } else {
                if (i < getKey() && hasLeftChild()) {
                    comparisonsDel++;
                    return getLeftChild().search(i);
                } else if (hasRightChild()) {
                    comparisonsDel++;
                    return getRightChild().search(i);
                }
            }
            return null;
        }