@NotNull public static <T, Loc> WeighingComparable<T, Loc> weigh( Key<? extends Weigher<T, Loc>> key, T element, Loc location) { final List<Weigher> weighers = COLLECTOR.forKey(key); return new WeighingComparable<T, Loc>( element, location, weighers.toArray(new Weigher[weighers.size()])); }
public static StatisticsService getStatisticsService() { String key = ((ApplicationInfoImpl) ApplicationInfoImpl.getShadowInstance()).getStatisticsServiceKey(); StatisticsService service = key == null ? null : COLLECTOR.findSingle(key); if (service != null) { return service; } return new RemotelyConfigurableStatisticsService( new StatisticsConnectionService(), new StatisticsHttpClientSender(), new StatisticsUploadAssistant()); }