code: private void rotateRight(TreeEntry<E> p) {
          if (p != null) {
              TreeEntry<E> l = p.left;
              p.left = l.right;
              if (l.right != null) {
                  l.right.parent = p;
              }
              l.parent = p.parent;
              if (p.parent == null) {
                  root = l;
              } else if (p.parent.right == p) {
                  p.parent.right = l;
              } else {
                  p.parent.left = l;
              }
              l.right = p;
              p.parent = l;
  
              // Original C code:
              // y->maxHigh=ITMax(y->left->maxHigh,ITMax(y->right->maxHigh,y->high))
              // Original C code:
              // x->maxHigh=ITMax(x->left->maxHigh,ITMax(y->maxHigh,x->high))
              p.maxHigh = Math.max(
                      p.left != null ? p.left.maxHigh : Long.MIN_VALUE,
                      Math.max(p.right != null ? p.right.maxHigh : Long.MIN_VALUE,
                              p.high));
              l.maxHigh = Math.max(p.maxHigh, Math.max(
                      l.left != null ? l.left.maxHigh : Long.MIN_VALUE, l.high));
          }
      }
docs: /* From CLR