class Foo { fun method(b: Boolean, elementComputable: Computable, processingContext: Any): WeighingComparable { return weigh(WEIGHER_KEY, elementComputable, ProximityLocation()) } companion object { fun weigh( key: Key>?, element: Computable, location: Loc ): WeighingComparable { return WeighingComparable(element, location, Array>(0) { null!! }) } val WEIGHER_KEY: Key? = null } } abstract class ProximityWeigher : Weigher() class ProximityLocation class Key

open class Weigher class Computable class WeighingComparable(element: Computable, location: Loc, weighers: Array>) : Comparable> { override fun compareTo(other: WeighingComparable): Int { return 0 } private fun getWeight(index: Int): Comparable<*>? { return null } }