title: Comparing Long values using Collections.sort(object)
body: <p>I'm trying to sort a simple list of objects by a long - the below isn't working because one of the long strings is pushed to the top simply because it starts with a lower number. So I'm looking for a way to sort these by the actual long values directly</p>
  
  <p>The current obj implementation looks something like the below. In the class I'm using this I call Collections.sort(trees);</p>
  
  <pre><code>public class Tree implements Comparable&lt;Tree&gt; {
      public String dist; //value is actually Long
  
      public int compareTo(Tree o) {
          return this.dist.compareTo(o.dist);
      }
  }
  </code></pre>