treeset java descending order using comparator

Java
TreeSet<Integer> set = new TreeSet<Integer>(new Comparator<Integer>()
  {
  public int compare(Integer i1,Integer i2)
        {
        return i2.compareTo(i1);
        }
  });
Source

Also in Java: