import java.util.stream.* interface A : Collection { override fun stream(): Stream = Stream.of() } fun foo(x: List, y: A) { x.stream().filter { it.length > 0 }.collect(Collectors.toList()) y.stream().filter { it.length > 0 } }