@VisibleForTesting NameSpaceContainer deleteEntity(final NamespaceKey path, final Type type, String version, boolean deleteRoot) throws NamespaceException { final List<NameSpaceContainer> entitiesOnPath = getEntitiesOnPath(path); final NameSpaceContainer container = lastElement(entitiesOnPath); if (container == null) { throw new NamespaceNotFoundException(path, String.format("Entity %s not found", path)); } return doDeleteEntity(path, type, version, entitiesOnPath, deleteRoot); }