code: public static <T extends Comparable<? super T>> TreeNode<T> removeInterval(IntervalTree<T> tree, TreeNode<T> root, Interval<T> interval) {
  		if (root == null)
  			return null;
  		if (interval.contains(root.midpoint)){
  			if (root.decreasing.remove(interval))
  				tree.size--;
  			root.increasing.remove(interval);
  			if (root.increasing.size() == 0){
  				return deleteNode(root);
  			}
  
  		} else if (interval.isLeftOf(root.midpoint)){
  			root.left = removeInterval(tree, root.left, interval);
  		} else {
  			root.right = removeInterval(tree, root.right, interval);
  		}
  		return root.balanceOut();
  	}
docs: A helper function for the {@link IntervalTree#remove(Interval)} method.
  It searches recursively for the base node of a target interval and
  removes the interval from the base node, if it is stored there. This is
  a more efficient way to remove an interval from the tree, since it
  doesn't iterate through all intervals, but performs a binary search in
  O(logn).
  
  @param tree The {@link IntervalTree} containing the subtree. Used primarily for
  housekeeping, such as adjusting the size of the tree, if needed.
  @param root The root of the currently traversed subtree. May be {@code null}.
  @param interval The target interval to be removed.
  @param <T> The type of the start and end points of the intervals, as well as
  the query point.
  @return The new root of the subtree, rooted at the current node, after the
  interval has been removed. This could be {@code null} if the interval
  was the last one stored at the subtree.