code: private int rank(Key key, RedBlackTreeNode<Key, Value> x) {
  	if (x == null)
  	    return 0;
  	int cmp = key.compareTo(x.getKey());
  	if (cmp < 0)
  	    return rank(key, x.getLeft());
  	else if (cmp > 0)
  	    return 1 + size(x.getLeft()) + rank(key, x.getRight());
  	else
  	    return size(x.getLeft());
      }
docs: number of keys less than key in the subtree rooted at x