title: Erasure elimination in scala : non-variable type argument is unchecked since it is eliminated by erasure
body: <p>I've got a sequence Seq[Any] that has a variety of objects in it (like String, Integer, List[String], etc). I'm trying to sift through the list and break it up into separate lists partitioned based on the class type. The following is a pattern I'm using in the code:</p>
  
  <pre><code>val allApis = mySequence.filter(_.isInstanceOf[String])
  </code></pre>
  
  <p>This works well and doesn't generate any warnings. However, when I try to do the same for filtering out the objects that are Lists of strings:</p>
  
  <pre><code>val allApis = mySequence.filter(_.isInstanceOf[List[String]])
  </code></pre>
  
  <p>I get a warning that says <strong>non-variable type argument String in type List[String] is unchecked since it is eliminated by erasure</strong>. Now, the technique actually works and I'm able to comfortably filter the sequence as desired, but I'm wondering what is the appropriate way to deal with the warning in an idiomatic way so that I know I don't have a serious bug lurking in the background waiting to blow up</p>