title: What should I do with unchecked cast for criteria.list()?
body: <p>I have a criteria that is returning a list of strings <code>List&lt;String&gt;</code>.</p>
  
  <p>I have following in the method</p>
  
  <pre><code> return criteria.list();
  </code></pre>
  
  <p>But the code shows </p>
  
  <pre><code> Type safety: Unchecked cast from List to List&lt;String&gt;
  </code></pre>
  
  <p>To avoid adding <code>@SuppressWarnings("unchecked")</code>
  and to make sure the types are safely converted (not sure if I should really do it), I read <a href="https://stackoverflow.com/questions/115692/how-to-avoid-type-safety-warnings-with-hibernate-hql-results">this question</a> and tried to add the solution to my code</p>
  
  <pre><code> return Collections.checkedList(criteria.list(),List&lt;String&gt;);
  </code></pre>
  
  <p>but it shows another error as following:</p>
  
  <pre><code>Multiple markers at this line
      - Type safety: Unchecked cast from List to List&lt;String&gt;
      - Syntax error on token "&gt;", Expression expected after this 
       token
  </code></pre>
  
  <ul>
  <li>I do not know if I should really use Collections.checkedList</li>
  <li>If I should use it, then how to use it?</li>
  </ul>
  
  <p>Thanks</p>