title: Cannot return object from generic method
body: <p>I don't understand why following code does not compile. I've declared generic type <code>T</code> which extends <code>Customer</code>. <code>Customer</code> is of type <code>Customer</code> so why I cannot return <code>Customer</code> object from this method without a cast? </p>
  
  <pre><code>public class CustomerExample {
  
      public &lt;T extends Customer&gt; T processCustomer(Customer customer) {
          return new Customer();
      }
  }
  
  class Customer {
  
  }
  </code></pre>
  
  <p>I get <code>java: incompatible types: Customer cannot be converted to T</code></p>