title: Java generics vs C# where keyword
body: <p>I have a method in a C# project that looks like this</p>
  
  <pre><code>public T AddEC&lt;T&gt;() where T : EntityComponent, new() {
      if (!HasEC&lt;T&gt;())
      {
        T nComponent = new T();
      }
  }
  </code></pre>
  
  <p>Now I have only recently started properly working with Java Generics, but I have no idea how i'd port a method like this, or if its even possible due to the language constraints, can anyone help?</p>