Your task is to read a file containing lines of text, and to write another file that contains these lines in reverse order. For example, if your input file contains the lines

Mary had a little lamb, 
its fleece was white as snow.

then your output file should contain the lines

its fleece was white as snow.
Mary had a little lamb, 

Complete the following file:

LineReverser.java

import java.io.FileReader; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Scanner; public class LineReverser { public static void main(String[] args) throws FileNotFoundException { String inputFileName = "mary.txt"; String outputFileName = "output.txt"; // TODO: Open the input and output files. // Read lines from input file. // Write lines in reverse order to output file. } }