((NotificationEmitter)instance).addNotificationListener(listener,
filter, handback);
instance.save();
final ScanManagerConfig loaded =
new XmlConfigUtils(file.getAbsolutePath()).readFromFile();
assertEquals(instance.getConfiguration(),loaded);
final ScanManagerConfig newConfig =
instance.getConfiguration();
newConfig.removeScan("tmp");
instance.setConfiguration(newConfig);
instance.save();
assertNotSame(loaded,instance.getConfiguration());
final ScanManagerConfig loaded2 =
new XmlConfigUtils(file.getAbsolutePath()).readFromFile();
assertEquals(instance.getConfiguration(),loaded2);
instance.load();
for (int i=0;i<4;i++) {
final Notification n = queue.poll(3,TimeUnit.SECONDS);
assertNotNull(n);