using javav tree