import java.util.*;

public class CollectionsTest {
  public static void main(String[] args) {
    List<Integer> integersList = new ArrayList<>();
    Map<Integer,String> integersMap  = new TreeMap<>();
    Set<Integer> integersSet = new TreeSet<>();
    
    integersList.add(1);
    integersList.add(4);
    integersList.add(3);
    integersList.add(2);
    integersList.add(3);
    
    integersMap.put(1, "A");
    integersMap.put(4, "B");
    integersMap.put(3, "C");
    integersMap.put(2, "D");
    integersMap.put(3, "E");
    
    System.out.println("Adding to Set");
    System.out.println("Adding 1: " + integersSet.add(1));
    System.out.println("Adding 4: " + integersSet.add(4));
    System.out.println("Adding 3: " + integersSet.add(3));
    System.out.println("Adding 2: " + integersSet.add(2));
    System.out.println("Adding 3: " + integersSet.add(3));
    
    System.out.println("Printing the List");
    for (Integer integer : integersList) {
        System.out.println(integer);
    }
    
    System.out.println("Printing the Map using keys");
    for (Integer key : integersMap.keySet()) {
        System.out.println(key);
    }

    System.out.println("Printing the Map using entries");
    for (String entry : integersMap.values()) {
        System.out.println(entry);
    }
    
    System.out.println("Printing the Set");
    for (Integer integer : integersSet) {
        System.out.println(integer);
    }

  }
}