title: Spring conversion service - from List<A> to List<B>
body: <p>I have registered a custom conversion service in a Spring 3 application. It works well for POJOs but it does not work on Lists.</p>
  
  <p>For example, I convert from <code>String</code> to <code>Role</code> and it works fine, but not for <code>List&lt;String&gt;</code> to <code>List&lt;Role&gt;</code>.</p>
  
  <p>All kind of <code>ClassCastExceptions</code> fly in the application when trying to inject Lists, no matter what they contain. The Conversion service calls the convertor for <code>List&lt;String&gt;</code> to <code>List&lt;Role&gt;</code> for all.</p>
  
  <p>This makes sense if you think about it. Type erasure is the culprit here and the convertion service actually sees <code>List</code> to <code>List</code>.</p>
  
  <p>Is there a way to tell the conversion service to work with generics?</p>
  
  <p>What other options do I have?</p>