class SimpleCatalogUtilsService implements CatalogUtilsService {

    @Override
    public void removeInProgressCommit(InProgressCommit commit, RepositoryConnection conn) {
        Revision revision = getRevision(commit.getResource(), conn);
        removeObject(commit, conn);

        Set<Resource> graphs = new HashSet<>();
        revision.getAdditions().ifPresent(graphs::add);
        revision.getDeletions().ifPresent(graphs::add);
        revision.getGraphRevision().forEach(graphRevision -> {
            graphRevision.getAdditions().ifPresent(graphs::add);
            graphRevision.getDeletions().ifPresent(graphs::add);
        });

        graphs.forEach(resource -> {
            if (!conn.contains(null, null, resource)) {
                remove(resource, conn);
            }
        });
    }

}