text: Collection, and therefore sits at the top of its own tree. What is the name of this interface?
  Map
  <E>syntax, which tells you that it is generic. When you declare a
  Collectioninstance, what is the advantage of specifying the type of objects that it will contain?
  Set
  Collection
  List
  Queue
  Map
  Deque
  List.
  Listusing streams, the enhanced
  forstatement, or iterators.(); } }
  FindDupsexample and modify it to use a
  SortedSetinstead of a
  Set. Specify a
  Comparatorso that case is ignored when sorting and identifying set elements.
  import java.util.*; public class FindDups { public static void main(String[] args) { Set<String> s = new HashSet<String>(); for (String a : args) s.add(a); System.out.println(s.size() + " distinct words: " + s); } }
  List<String>and applies
  String.trimto each element.
  forstatement does not allow you to modify the
  List. Using an instance of the
  Iteratorclass); } } }
  Set,
  List,
  Queue, and
  Map. For each of the following four assignments, specify which of the four core interfaces is best-suited, and explain how to use it to implement the assignment.
  List. Choose a random employee by picking a number between
  0and
  size()-1.
  Set. Collections that implement this interface don't allow the same element to be entered more than once.
  Map, where the keys are first names, and each value is a count of the number of employees with that first name.
  Queue. Invoke
  add()to add employees to the waiting list, and
  remove()to remove them.