}
private Resource prepareSuperimposingResource(String superimposedPath, String sourcePath, boolean registerParent, boolean overlayable) {
Resource resource = mock(Resource.class);
when(resource.getPath()).thenReturn(superimposedPath);
ValueMap props = new ValueMapDecorator(new HashMap<String, Object>());
props.put(PROP_SUPERIMPOSE_SOURCE_PATH, sourcePath);
props.put(PROP_SUPERIMPOSE_REGISTER_PARENT, registerParent);
props.put(PROP_SUPERIMPOSE_OVERLAYABLE, overlayable);
when(resource.adaptTo(ValueMap.class)).thenReturn(props);
when(resourceResolver.getResource(superimposedPath)).thenReturn(resource);
return resource;
}