code: private void rotateRight(TreeMapEntry<K,V> p) {
          if (p != null) {
              TreeMapEntry<K,V> 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;
          }
      }
docs: From CLR