title: Making a generic comparator class
body: <p>I'm trying to make a comparator that can take any type of an element to compare.  I'm unsure about how to create the class.  I just want it to compare two elements of the same type (But whatever type the client gives it, ex: Integer, String, Double, etc...) to see which one is greater then the other.</p>
  
  <pre><code>public class InsertionComparator implements Comparator&lt;T&gt;
  {
  /**
   * Compares two elements.
   * 
   * @param  f1  The first element you want to compare.
   * @param  f2  The second element you want to compare.
   * @return  -1,0,1  Whether or not one is greater than, less than,
   * or equal to one another.
   */
  public int compare(&lt;T&gt; element1,&lt;T&gt; element2)
  {
      if(element1 &lt; element2)
      {
          return -1;
      }
      else
      {
          if(element1 &gt; element2)
          {
              return 1;
          }
          else
          {
              return 0;
          }
      } 
  }
  }
  </code></pre>
  
  <p>Please help, thank you!</p>