interface A interface B class Test { fun test(a: A?, b: B, list: MutableList>) { if (a != null) { list.add(a to b) } } } class Pair(val first: A, val second: B) infix fun A.to(that: B) = Pair(this, that)