It is an interesting choice the developers of the java.nio.file.Path made inheriting from Iterable. It also inherits from Comparable and Watchable too. At the same time, Path is really not a collection because it is a utility class. Instead of inheriting from Iterable, there should have been a method Path::getIterable or even better, getNameIterable. Sadly, Kotlin exposes that bad design choice in trying to make collections easier to use (but Path should not be a collection).