Added stream close snippet

This commit is contained in:
Sunil Gulabani 2016-10-11 14:14:11 +05:30
parent 09b7c6e822
commit 5b09ae5275
1 changed files with 1 additions and 0 deletions

View File

@ -102,6 +102,7 @@ public class FileOperationsTest {
StringBuilder data = new StringBuilder();
Stream<String> lines = Files.lines(path);
lines.forEach(line -> data.append(line).append("\n"));
lines.close();
Assert.assertEquals(expectedData, data.toString().trim());
}