AVLTree extends AbstractSelfBalancingBinarySearchTree { @Override public Node insert(int element) { Node newNode = super.insert(element); rebalance((AVLNode)newNode); return newNode; }  @Override Node insert(int element); @Override Node delete(int element);  }
@Test public void testInsert() { AVLTree tree = new AVLTree(); tree.insert(20); tree.insert(15); tree.insert(25); tree.insert(22); tree.insert(21); Assert.assertEquals(tree.size, 5); Assert.assertEquals((int) tree.root.value, 20); Assert.assertEquals((int) tree.root.left.value, 15); AVLNode rightSubtree = (AVLNode) tree.root.right; Assert.assertEquals((int) rightSubtree.value, 22); Assert.assertEquals((int) rightSubtree.height, 1); Assert.assertEquals((int) rightSubtree.right.value, 25); Assert.assertEquals(((AVLNode) rightSubtree.right).height, 0); Assert.assertEquals((int) rightSubtree.left.value, 21); Assert.assertEquals(((AVLNode) rightSubtree.left).height, 0); testTreeBSTProperties(tree.root); }