title: Converts ArrayList into a sorted set (TreeSet) and returns it
body: <p>I a method that takes a list of numbers (e.g. <code>ArrayList</code>) and converts it into a sorted set (e.g. <code>TreeSet</code>) and returns it. I wrote code, but I'm having some problems.</p>
  
  <pre><code>public TreeSet getSort (ArrayList list){
     TreeSet set =new TreeSet(list);
      return set;
  </code></pre>
  
  <p>My problem is in main:</p>
  
  <pre><code>ArrayList List = new ArrayList();
      List.add(5);
      List.add(55);
      List.add(88);
      List.add(555);
      List.add(154);
      System.out.println("the TreeSet of ArrayList is : " + getSort(List));
  </code></pre>