title: Java override constructor using List<CustomObjects> - "same erasure" error
body: <p>Hi I want to override constructor in custom class MyList.</p>
  
  <p>Code below can be compiled, I receive "same erasure" error. For compiler <code>List&lt;CustomClass1&gt;</code> is same type as <code>List&lt;CustomClass2&gt;</code></p>
  
  <p>Can someone suggest me how to solve this. I try using <code>List&lt;Object&gt;</code> and using <code>instanceof</code> but I can't solve this but without success</p>
  
  <pre><code>private static class MyList {
  
      private int type;
  
      public MyList (List&lt;CustomClass1&gt; custom1) {
                   type = 1;
      }
  
      public MyList (List&lt;CustomClass2&gt; custom2) {
                   type = 2;
  
      }
  }
  </code></pre>