Tree Simulator in Java