static <T extends Node<T, ?>> Iterable<T> getNodesOfType(Iterable<? extends Node<?, ?>> nodes, Class<T> nodeSelector) {
    return Iterators.filter(Iterators.map(nodes, n -> nodeSelector.isInstance(n)? nodeSelector.cast(n) : null), Iterators.notNullFilter());
  }
static <T extends Node<T, ?>> Iterable<T> getNodesOfType(Iterable<? extends Node<?, ?>> nodes, Class<T> nodeSelector)