@Override public void addConfigSources(List<ConfigSource> configSourcesToAdd) { if (configSourcesToAdd == null || configSourcesToAdd.isEmpty()) { return; } List<ConfigSource> allConfigSources = new ArrayList<>(); // start with all existing ConfigSources if (this.configSources != null) { for (ConfigSource configSource : this.configSources) { allConfigSources.add(configSource); } } for (ConfigSource configSourceToAdd : configSourcesToAdd) { configSourceToAdd.setOnAttributeChange(this::onAttributeChange); allConfigSources.add(configSourceToAdd); } this.configSources = sortDescending(allConfigSources); }