test predicates
implemented my own flatten function since the standard one doesnt seem to work on whatever my getAllNodes function returns
test-specific predicates and functions