title: Orika - mapping object to list (one to many mapping)
body: <p>I have following two classes</p>
  
  <pre><code>class A {
      class InnerA {
          private String field;
  
          // getters/setters
      }
  
      private Collection&lt;InnerA&gt; collection;
  
      // getters/setters
  }
  
  class B {
      private String field;
  
      // getters/setters
  }
  </code></pre>
  
  <p>Is it possible to map A into Collection of B (A.collection.field should be mapped into Collection of B.field)?</p>
  
  <p>I tried to use custom converter but I have only to manage java.lang.VerifyError:</p>
  
  <pre><code>    mapperFactory.getConverterFactory().registerConverter(new CustomConverter&lt;A, Collection&lt;B&gt;&gt;() {
  
          @Override
          public Collection&lt;B&gt; convert(
                  A arg0, Type&lt;? extends Collection&lt;B&gt;&gt; arg1) {
  
              Collection&lt;B&gt; result = new ArrayList&lt;B&gt;();
  
              Iterator&lt;Item&gt; it = arg0.getCollection().iterator();
              while(it.hasNext()){
                  it.next();
                  result.add(new B());
              }
  
              return result;
          }
  
      });
  </code></pre>
  
  <p>results in:</p>
  
  <pre><code>java.lang.VerifyError: Inconsistent args count operand in invokeinterface in method    ma.glasnost.orika.generated.Orika_ArrayList_A_Mapper845657274.mapAtoB(Ljava/lang/Object;Ljava/lang/Object;Lma/glasnost/orika/MappingContext;)V at offset 74  
  at java.lang.Class.getDeclaredConstructors0(Native Method)  
  at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404)  
  at java.lang.Class.getConstructor0(Class.java:2714)     
  at java.lang.Class.newInstance0(Class.java:343)     
  at java.lang.Class.newInstance(Class.java:325)  
  </code></pre>