title: java generic object istance of generic class
body: <p>I have this situation:</p>
  
  <p>I receive a string from JSon file and I parse it correclty into a list, so at the end I have a list of <em>myObject</em></p>
  
  <p>I want create a generic method to search one thing into this list. I would to create a method that has how parameter one generic list of object and the Type of this object, after during the scan of the list, cast this generic object into the type that is passed.</p>
  
  <pre><code>List&lt;Mission_queue&gt; queue = gson.fromJson((String)response.get(1),listType);
  Utility.CheckProperty(queue, Mission_queue.class, paramName, paramSearch);
  </code></pre>
  
  <p>My Utility method</p>
  
  <pre><code>public static Boolean CheckProperty(List&lt;?&gt; list, Class&lt;?&gt; classType, String propertyName, String propertyValue) {
      int idx = 0;
      for (Iterator&lt;?&gt; it = list.iterator(); it.hasNext(); idx++) {
          Object obj = it.next();
          // here I want cast my generic Obj from Object to ClassType
      }
      return false;
  }
  </code></pre>
  
  <p>So, how could I cast? I would create a generic method because I will have a lot of different list, but every time I need to search something inside.</p>
  
  <p>Have you some ideas?</p>
  
  <p>Thanks very much</p>