Sort an array list of strings by increasing length, and so that strings of the same length are sorted lexicographically. Hint: Supply a Comparator.

Complete the following file:

Use the following file:

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

   Sort an array list of strings by increasing length.
public class StringSortDemo
   public static void main(String[] args)
      ArrayList<String> list = new ArrayList<String>();
      Scanner in = new Scanner(;
      boolean done = false;      
      while (!done)
         System.out.println("Enter a string or a blank line to quit");
         String input = in.nextLine();
         if (input.equals(""))
            done = true;

      Collections.sort(list, new StringLengthLexComparator());