getAllValues and getAllValuesMT refactored into AbstractTrees