Implementation of a binary search tree in java