Impl of treenode in java