How to convert comma delimited String to List of T in Core Java
<p>"first time long time" as they say on the radio talk shows...</p>

<p>I'm trying to parse a delimited property into a List.  Simple enough, but for some reason I can't figure how to do this in a generic fashion using only Core Java.  By generic, I mean the type of List to create may be a List&lt; String >, List&lt; Integer >, or List&lt; Double >.  My latest stab at it below gives runtime exceptions with non-Strings because I'm trying to cast from String to e.g. Double which is not allowed.  Any help is appreciated.</p>

<pre><code>public static &lt;T&gt; void parsePropsToList(String propName, String delim, List&lt;T&gt; listToFill){
   //This is paired down for convenience - assume getSplitList correctly parses to List&lt;String&gt;
   List&lt;String&gt; stringList = PropsManager.getSplitList(propName, delim);
   for(String s : stringList){
       listToFill.add((T)s);
   }
}
</code></pre>
