in src/main/java/org/apache/sling/testing/resourceresolver/MockResourceResolver.java [312:331]
public void delete(final @NotNull Resource resource) throws PersistenceException {
this.deletedResources.add(resource.getPath());
this.temporaryResources.remove(resource.getPath());
final String prefixPath = resource.getPath() + '/';
synchronized (this.resources) {
for (final Map.Entry<String, Map<String, Object>> e : this.resources.entrySet()) {
if (e.getKey().startsWith(prefixPath)) {
this.deletedResources.add(e.getKey());
}
}
final Iterator<Map.Entry<String, Map<String, Object>>> i =
this.temporaryResources.entrySet().iterator();
while (i.hasNext()) {
final Map.Entry<String, Map<String, Object>> e = i.next();
if (e.getKey().startsWith(prefixPath)) {
i.remove();
}
}
}
}