### Question:
ModelCatalog { public static void set(Model<?, ?> model) { userCatalogs.compute(model.username(), (user, userCatalog) -> { if (userCatalog == null) { userCatalog = new UserCatalog(); } userCatalog.set(model); return userCatalog; }); } private  ModelCatalog(); static void set(Model<?, ?> model); static Model<D, C> get(
        String username, String modelName, Class<D> dataClass, Class<C> configClass
    ); static boolean exists(String username, String modelName); static Optional<String> type(String username, String modelName); static Model<?, ?> drop(String username, String modelName); static Collection<Model<?, ?>> list(String username); static Model<?, ?> list(String username, String modelName); static void removeAllLoadedModels();  }### Answer:
@Test void onlyAllowOneCatalogInCE() { GdsEdition.instance().setToCommunityEdition(); Model<String, TestTrainConfig> model = Model.of( USERNAME, "testModel", "testAlgo", GRAPH_SCHEMA, "testTrainData", TestTrainConfig.of() ); ModelCatalog.set(model); assertDoesNotThrow(() -> { ModelCatalog.set(Model.of( USERNAME, "testModel2", "testAlgo2", GRAPH_SCHEMA, 1337L, TestTrainConfig.of() )); }); Model<Long, TestTrainConfig> model2 = Model.of( USERNAME, "testModel2", "testAlgo", GRAPH_SCHEMA, 1337L, TestTrainConfig.of() ); IllegalArgumentException ex = assertThrows( IllegalArgumentException.class, () -> ModelCatalog.set(model2) ); assertEquals("Community users can only store one model in the catalog", ex.getMessage()); }
@Test void shouldThrowOnOverridingModels() { Model<String, TestTrainConfig> model = Model.of( USERNAME, "testModel", "testAlgo", GRAPH_SCHEMA, "modelData", TestTrainConfig.of() ); ModelCatalog.set(model); IllegalArgumentException ex = assertThrows( IllegalArgumentException.class, () -> ModelCatalog.set(model) ); assertEquals("Model with name `testModel` already exists", ex.getMessage()); }