Implements an ADT for a general tree in Java