port) { return instances.stream() .map(i -> getTagOrFail(i, TAG_KEY_NAME)) .map(name -> buildUri(securityProtocol, name, port)) .collect(Collectors.toList()); } • Kotlin private fun buildKafkaUris(instances: List<Instance>, securityProtocol: String, port: String): List<String> { return instances .map { getTag(it, TAG_KEY_NAME) } .map { buildUri(securityProtocol, it, port) } } Null safety through types (see further)