private void rotateLeft(Node<T> currentNode, boolean changeRootOfSubtree) {
        if (currentNode.getParent() != null) {
            if (changeRootOfSubtree) {
                Node<T> oldRoot = currentNode;
                Node<T> newRoot = currentNode.getRightChild();
                newRoot.setParent(oldRoot.getParent());
                oldRoot.getParent().setRightChild(newRoot);
                Node<T> lCh = newRoot.getLeftChild();
                if (lCh != null) {
                    lCh.setParent(oldRoot);
                }
                oldRoot.setRightChild(lCh);
                oldRoot.setParent(newRoot);
                newRoot.setLeftChild(oldRoot);
            } else {
                Node<T> rCh = currentNode.getRightChild();
                if (currentNode.getParent() != null) {
                    currentNode.getParent().setLeftChild(rCh);
                }
                if (rCh != null) {
                    rCh.setParent(currentNode.getParent());
                }
                currentNode.setParent(rCh);
                Node<T> lCh = rCh.getLeftChild();
                if (lCh != null) {
                    lCh.setParent(currentNode);
                }
                currentNode.setRightChild(lCh);
                if (rCh != null) {
                    rCh.setLeftChild(currentNode);
                }
            }
        } else {
            Node<T> oldRoot = this.getNode();
            this.setNode(currentNode.getRightChild());
            this.getNode().setParent(null);
            Node<T> lCh = getNode().getLeftChild();
            if (lCh != null) {
                lCh.setParent(oldRoot);
            }
            oldRoot.setRightChild(lCh);
            getNode().setLeftChild(oldRoot);
            oldRoot.setParent(getNode());
        }
    }