class Foo { public static WeighingComparable weigh(final Key> key, final Computable element, final Loc location) { return new WeighingComparable(element, location, new Weigher[0]); } public WeighingComparable method(boolean b, final Computable elementComputable, Object processingContext) { return weigh(WEIGHER_KEY, elementComputable, new ProximityLocation()); } public static final Key WEIGHER_KEY = null; } abstract class ProximityWeigher extends Weigher { } class ProximityLocation { } class Key

{ } class Weigher { } class Computable {} class WeighingComparable implements Comparable> { public WeighingComparable(final Computable element, final Loc location, final Weigher[] weighers) { } public int compareTo(@NotNull final WeighingComparable comparable) { return 0; } @Nullable private Comparable getWeight(final int index) { return null; } }