Generic implementation of binary search tree in Java