underTest.onEvent(prepareNodeCreateEvent(superimposedResource));
// ensure the superimposed resource is detected and registered
List<SuperimposingResourceProvider> providers = IteratorUtils.toList(underTest.getRegisteredProviders());
assertEquals(1, providers.size());
SuperimposingResourceProvider provider = providers.iterator().next();
assertEquals(SUPERIMPOSED_PATH, provider.getRootPath());
assertEquals(ORIGINAL_PATH, provider.getSourcePath());
assertFalse(provider.isOverlayable());
verify(bundleContext).registerService(anyString(), same(provider), any(Dictionary.class));
// simulate a change in the original path
superimposedResource.adaptTo(ValueMap.class).put(PROP_SUPERIMPOSE_SOURCE_PATH, "/other/path");
underTest.onEvent(prepareNodeChangeEvent(superimposedResource));
// ensure the superimposed resource update is detected and a new provider instance is registered
providers = IteratorUtils.toList(underTest.getRegisteredProviders());
assertEquals(1, providers.size());
SuperimposingResourceProvider provider2 = providers.iterator().next();
assertEquals(SUPERIMPOSED_PATH, provider2.getRootPath());
assertEquals("/other/path", provider2.getSourcePath());
assertFalse(provider2.isOverlayable());
verify(bundleContext).registerService(anyString(), same(provider2), any(Dictionary.class));
// simulate node removal
underTest.onEvent(prepareNodeRemoveEvent(superimposedResource));