import java.util.Set;
import java.util.TreeSet;

/**
   This program tests a tree set with a class that implements the Comparable interface.
*/
public class TreeSetDemo
{
   public static void main(String[] args)
   {
      Country country1 = new Country("Uruguay", 176220);
      Country country2 = new Country("Thailand", 514000);
      Country country3 = new Country("Belgium", 30510);

      Set<Country> countries = new TreeSet<Country>();

      countries.add(country1);
      countries.add(country2);
      countries.add(country3);
      countries.add(country1); // Has no effect
      countries.remove(country3); 
      countries.remove(country3); // Has no effect
      countries.add(country3);

      System.out.println(countries);
   }
}
