title: Checking java List<object> object type
body: <p>I have a generic function that returns a <code>List&lt;?&gt;</code>. If it works correctly, it will return a <code>List&lt;LightSensor&gt;</code>, but I cannot directly convert the result of the function to a variable of type <code>List&lt;LightSensor&gt;</code>. How can I check if the class in the List is a LightSensor correctly? (e.g. check if <code>List&lt;?&gt; = List&lt;LightSensor&gt;</code>)
  Also, What is the best way to cast it correctly once I've checked?<br/>
  BTW the class LightSensor extends Object and a version of Serializable</p>