Replace @Cleanup with try-with-resources