budget/src/main/java/budget/backend/structures/AVLSearchTree.java
private AVLTreeNode<K, V> case4(AVLTreeNode<K, V> n){
    n = (n.getRight()).getLeft();
		//inserting child to the right child of grandchild
		AVLTreeNode<K,V> subT = n.getLeft();
		n.setLeft((n.getParent()).getParent());

		(n.getLeft()).setRight(subT);
		subT.setParent(n.getLeft());

		subT = n.getRight();
		n.setRight(n.getParent());

		(n.getRight()).setLeft(subT);
		subT.setParent(n.getRight());

		n.setParent((n.getLeft()).getParent());
		(n.getLeft()).setParent(n);
		(n.getRight()).setParent(n);
		return n;
	}
/**
   * inbalance is caused by a right child and its left child
   * @param n the grandchild
   */
inbalance is caused by a right child and its left child
@param n the grandchild
inbalance is caused by a right child and its left child @param n the grandchild
private AVLTreeNode<K, V> case4(AVLTreeNode<K, V> n){
    n = (n.getRight()).getLeft();
		AVLTreeNode<K,V> subT = n.getLeft();
		n.setLeft((n.getParent()).getParent());
		(n.getLeft()).setRight(subT);
		subT.setParent(n.getLeft());
		subT = n.getRight();
		n.setRight(n.getParent());
		(n.getRight()).setLeft(subT);
		subT.setParent(n.getRight());
		n.setParent((n.getLeft()).getParent());
		(n.getLeft()).setParent(n);
		(n.getRight()).setParent(n);
		return n;
	}
private AVLTreeNode < K , V > case4 ( AVLTreeNode < K , V > n ) { n = ( n . getRight ( ) ) . getLeft ( ) ; AVLTreeNode < K , V > subT = n . getLeft ( ) ; n . setLeft ( ( n . getParent ( ) ) . getParent ( ) ) ; ( n . getLeft ( ) ) . setRight ( subT ) ; subT . setParent ( n . getLeft ( ) ) ; subT = n . getRight ( ) ; n . setRight ( n . getParent ( ) ) ; ( n . getRight ( ) ) . setLeft ( subT ) ; subT . setParent ( n . getRight ( ) ) ; n . setParent ( ( n . getLeft ( ) ) . getParent ( ) ) ; ( n . getLeft ( ) ) . setParent ( n ) ; ( n . getRight ( ) ) . setParent ( n ) ; return n ; }
inbalance is caused by a right child and its left child
 @param n the grandchild
inbalance is caused by a right child and its left child @param n the grandchild
//inserting child to the right child of grandchild