void () { final String[] log = new String[]{""}; MavenImportingSettings s = new MavenImportingSettings(); s.addListener(new MavenImportingSettings.Listener() { @Override public void createModuleForAggregatorsChanged() { log[0] += "changed "; } @Override public void updateAllProjectStructure() { } }); s.setCreateModulesForAggregators(true); s.setCreateModulesForAggregators(false); assertEquals("changed ", log[0]); s.clone().setCreateModulesForAggregators(true); s.clone().setCreateModulesForAggregators(false); assertEquals("changed ", log[0]); }