diff --git a/core-java-io/src/test/java/com/baeldung/filechannel/FileChannelUnitTest.java b/core-java-io/src/test/java/com/baeldung/filechannel/FileChannelUnitTest.java index 497ce33f0d..312ec7a459 100644 --- a/core-java-io/src/test/java/com/baeldung/filechannel/FileChannelUnitTest.java +++ b/core-java-io/src/test/java/com/baeldung/filechannel/FileChannelUnitTest.java @@ -66,6 +66,7 @@ public class FileChannelUnitTest { } assertEquals(expected_value, out.toString()); + out.close(); channel.close(); fin.close(); } @@ -141,6 +142,7 @@ public class FileChannelUnitTest { channel.position(4); assertEquals(4, channel.position()); + out.close(); channel.close(); reader.close(); }