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