reorganize tests and add a tree test
java fix