class GraphStoreCatalog {

    public static void remove(
        String username,
        NamedDatabaseId databaseId,
        String graphName,
        Consumer<GraphStoreWithConfig> removedGraphConsumer,
        boolean failOnMissing
    ) {
        UserCatalog.UserCatalogKey userCatalogKey = UserCatalog.UserCatalogKey.of(databaseId, graphName);

        Optional
            .ofNullable(getUserCatalog(username).remove(userCatalogKey))
            .ifPresentOrElse(
                dropGraph(username, removedGraphConsumer, userCatalogKey),
                () -> handleMissingGraph(userCatalogKey, failOnMissing)
            );
    }

    private  GraphStoreCatalog();

}