T (Collection<T> objects) { TextMateWeigh max = TextMateWeigh.ZERO; T result = null; for (T object : objects) { TextMateWeigh weigh = myWeigher.weigh(myScopeSupplier.apply(object), myScope); if (weigh.weigh > 0 && weigh.compareTo(max) > 0) { max = weigh; result = object; } } return result; }