Simple tree representation in java