Set<MetricEvent> () { final Set<MetricEvent> registry = Registry.getAll().stream() .filter(key -> key.isChangedFromDefault() && !StringUtil.equals(key.getKey(), DISABLE_INTELLIJ_PROJECT_ANALYTICS)) .map(key -> REGISTRY.metric(REGISTRY_KEY.with(key.getKey()))) .collect(Collectors.toSet()); final Set<MetricEvent> experiments = Experiments.EP_NAME.getExtensionList().stream() .filter(f -> Experiments.getInstance().isFeatureEnabled(f.id)) .map(f -> EXPERIMENT.metric(REGISTRY_KEY.with(f.id))) .collect(Collectors.toSet()); final Set<MetricEvent> advancedSettings = AdvancedSettingBean.EP_NAME.getExtensionList().stream() .filter(f -> ((AdvancedSettingsImpl)AdvancedSettings.getInstance()).isNonDefault(f.id)) .map(f -> ADVANCED_SETTING.metric(REGISTRY_KEY.with(f.id))) .collect(Collectors.toSet()); final Set<MetricEvent> result = new HashSet<>(registry); result.addAll(experiments); result.addAll(advancedSettings); return result; }