2.
//collecting file contents (lines) in a list
Lets say there is a file called file1.txt and has the following 3 lines
Line 1
Line 2
Line 3
What will be the output of below code
File myFile = new File("location of the file1.txt")
def list = myFile.collect { it }
println "list : $list"