A generic tree implementation in Java