traverseFilter

fun <A : PsiElement, B : Any> PsiElement.traverseFilter(on: Class<A>, f: (A) -> B?): List<B>

traverse and filters starting from the root node this down to all it's children and applying f