void () { final String[] log = new String[]{""}; MavenGeneralSettings s = new MavenGeneralSettings(); s.addListener(new MavenGeneralSettings.Listener() { @Override public void changed() { log[0] += "changed "; } }); s.setMavenHomeType(MavenWrapper.INSTANCE); assertEquals("changed ", log[0]); s.clone().setMavenHomeType(BundledMaven3.INSTANCE); assertEquals("changed ", log[0]); }