AVLTree extends AbstractSelfBalancingBinarySearchTree { protected Node doubleRotateLeftRight(Node node) { node.left = avlRotateLeft(node.left); return avlRotateRight(node); }  @Override Node insert(int element); @Override Node delete(int element);  }
@Test public void testDoubleRotateLeftRight() { Node root = new AVLNode(5, null, null, null); Node leftChild = new AVLNode(3, root, null, null); root.left = leftChild; Node leftGrandChild = new AVLNode(1, leftChild, null, null); Node rightGrandChild = new AVLNode(4, leftChild, null, null); leftChild.left = leftGrandChild; leftChild.right = rightGrandChild; AVLTree tree = new AVLTree(); Node rotated = tree.doubleRotateLeftRight(root); Assert.assertEquals((int) rotated.value, 4); Assert.assertEquals((int) rotated.left.value, 3); Assert.assertEquals((int) rotated.right.value, 5); Assert.assertEquals((int) rotated.left.left.value, 1); Assert.assertNull(rotated.parent); Assert.assertEquals(rotated.left.parent.value, rotated.value); Assert.assertEquals(rotated.right.parent.value, rotated.value); Assert.assertEquals(rotated.left.left.parent.value, rotated.left.value); }