Find floor and ceiling in the BST
This:


private static class IntegerObj {
    Integer obj = null;
}



really made me wonder. You're threading this object through recursive calls to hold the answer.

Instead you can remove this class and change your methods to return an int:

public int ceiling(int val) {
  return recurseCeiling(root, null, val);
}

public int floor(int val) {
  return recurseFloor(root, null, val);
}

private int recurseCeiling(TreeNode node, Integer ceil, int value) {
  if (node == null) {
    return ceil;
  }
  if (value &lt;= node.item) {
    return recurseCeiling(node.left, node.item, value);
  }
  return recurseCeiling(node.right, ceil, value);
}

private int recurseFloor(TreeNode node, Integer floor, int value) {
  if (node == null) {
    return floor;
  }
  if (value &lt; node.item) {
    return recurseFloor(node.left, floor, value);
  }
  return recurseFloor(node.right, node.item, value);
}


We can now see that these methods can be written iteratively

private int recurseCeiling(TreeNode node, Integer ceil, int value) {
  while (node != null) {
    if (value &lt;= node.item) {
      ceil = node.item;
      node = node.left;
    } else {
      node = node.right;
    }
  }
  return ceil;
}

private int recurseFloor(TreeNode node, Integer floor, int value) {
  while (node != null) {
    if (value &lt; node.item) {
      node = node.left;
    } else {
      floor = node.item;
      node = node.right;
    }
  }
  return floor;
}