_Originally posted by @gandola in https://github.com/feedzai/feedzai-openml-java/pull/116#discussion_r911781224_: `LightGBMBinaryClassificationModel` is a autoclosable. this means that we should make use of it. 1- `LightGBMBinaryClassificationModel::close()` should be responsible to release all the resources related with the instance. 2- Use `Try...With...Resources` (similar to python With clause) to ensure that resources are released Example: ``` try(final LightGBMBinaryClassificationModel model = fit(...)){ return getClassScores(dataset, model, maxInstancesToScore); } // You don't need to explisitly call the close() `Try...With...Resources` will do that for you. ``` We should do that for all Autoclosable resources.