In Groovy 1.8.6 I need to move a line just before another one. I'm interested in any improvements.fileToChange = new File('.classpath')linesToKeep = []fileToChange.eachLine {    if (it.contains('line to move')) {        lineToMove = it    } else {        linesToKeep.add(it)    }}fileToChange.withWriter { out ->    linesToKeep.each {        if (it.contains('line to recognize')) {            out.writeLine(lineToMove)        }         out.writeLine(it)    }}
Move a line in a file
beginner;groovy