object ModelConfigurationStore { val modelConfigurations = mutableListOf().observable() fun save(path: Path) = modelConfigurations .toJSON() .save(path, CREATE, TRUNCATE_EXISTING) fun load(path: Path) { if (Files.exists(path)) { modelConfigurations.setAll(loadJsonArray(path, READ).toModel()) } else { modelConfigurations.clear() } } }