diff --git a/src/test/java/org/apache/commons/collections4/AbstractObjectTest.java b/src/test/java/org/apache/commons/collections4/AbstractObjectTest.java index f79fb962f..7e144136b 100644 --- a/src/test/java/org/apache/commons/collections4/AbstractObjectTest.java +++ b/src/test/java/org/apache/commons/collections4/AbstractObjectTest.java @@ -297,7 +297,11 @@ public abstract class AbstractObjectTest extends BulkTest { */ protected Object readExternalFormFromDisk(final String path) throws IOException, ClassNotFoundException { final FileInputStream stream = new FileInputStream(path); - return readExternalFormFromStream(stream); + try { + return readExternalFormFromStream(stream); + } finally { + stream.close(); + } } /**