question: private static void writeFile ( File file , List < String > lines ) throws IOException { if ( ! file . exists ( ) ) file . createNewFile ( ) ; FileWriter fw = new FileWriter ( file ) ; BufferedWriter Bw = new BufferedWriter ( fw ) ; PrintWriter pw = new PrintWriter ( Bw ) ; for ( String line : lines ) pw . println ( line ) ; Bw . close ( ) ; fw . close ( ) ; pw . close ( ) ; }
target:  Writes the lines given in input in file.