code: private MtasRBTreeNode addRange(MtasRBTreeNode n, Integer left, Integer right,
        int additionalId, long additionalRef, Integer id, Long ref) {
      MtasRBTreeNode localN = n;
      if (localN == null) {
        String key = left.toString() + "_" + right.toString();
        localN = new MtasRBTreeNode(left, right, MtasRBTreeNode.RED, 1);
        localN.addIdAndRef(id, ref, additionalId, additionalRef);
        index.put(key, localN);
      } else {
        if (left <= localN.left) {
          localN.leftChild = addRange(localN.leftChild, left, right, additionalId,
              additionalRef, id, ref);
          updateMax(localN, localN.leftChild);
        } else {
          localN.rightChild = addRange(localN.rightChild, left, right,
              additionalId, additionalRef, id, ref);
          updateMax(localN, localN.rightChild);
        }
        if (isRed(localN.rightChild) && !isRed(localN.leftChild)) {
          localN = rotateLeft(localN);
        }
        if (isRed(localN.leftChild) && isRed(localN.leftChild.leftChild)) {
          localN = rotateRight(localN);
        }
        if (isRed(localN.leftChild) && isRed(localN.rightChild)) {
          flipColors(localN);
        }
        localN.n = size(localN.leftChild) + size(localN.rightChild) + 1;
      }
      return localN;
    }
docs: Adds the range.
  
  @param n the n
  @param left the left
  @param right the right
  @param additionalId the additional id
  @param additionalRef the additional ref
  @param id the id
  @param ref the ref
  @return the mtas RB tree node