title: calling Overloaded method from a generic method
body: <p>How to create a generic method which can call overloaded methods?
  I tried but it gives a compilation error.</p>
  
  <p>Test.java:19: incompatible types
  found   : java.lang.Object
  required: T
  T newt = getCloneOf(t);
                                                     ^</p>
  
  <pre><code>import java.util.*;
  
  public class Test {
  
  
   private Object getCloneOf(Object s) {
    return new Object();
   }
  
   private String getCloneOf(String s) {
    return new String(s);
   }
  
   private &lt;T&gt; Set&lt;T&gt; getCloneOf(Set&lt;T&gt; set){
    Set&lt;T&gt; newSet = null;
    if( null != set) {
     newSet = new HashSet&lt;T&gt;();
     for (T t : set) {
      T newt = getCloneOf(t);
      newSet.add(newt);
     }
    }
   }
  
  }    
  </code></pre>