title: How set local variable to a type which was passed in as method parameter
body: <p>I'm new to Java generics and I'm trying to set a local variable to a passed in type. The passed-in type extends the custom class Model:</p>
  
  <p>Something as follows:</p>
  
  <pre><code>public void myMethod(&lt;T extends Model&gt; MyType){
  
      MyType item = (MyType)getObjectFromStore();
  
  }
  </code></pre>
  
  <p>Where MyType could be of class Model or its sub-classes.</p>
  
  <p>Is this possible in Java? I appreciate any pointers in the right direction. I realize this is probably a basic question but I can't seem to find the right way to approach this.</p>