title: Can Orika map nested collections?
body: <p>I would like to map a field with nested collection using Orika library. My field in class is defined as:</p>
  
  <pre><code>private final List&lt;List&lt;Pojo&gt;&gt; list = new LinkedList&lt;List&lt;Pojo&gt;&gt;();
  </code></pre>
  
  <p>Pojo is a simple POJO class. Unfortunately I've got a MappingException caused by NullPointerException in Orika's internal logic.</p>
  
  <p>Did I do something in wrong way? Maybe I need to use Custom Mapping feature?</p>
  
  <p>EDIT:</p>
  
  <p>Here is my code:</p>
  
  <pre><code>public class Pojo {
  private int field;
  
  public int getField() {
      return field;
  }
  
  public void setField(final int field) {
      this.field = field;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>public class Source {
      private final List> list = new LinkedList>();</p>
  
  <pre><code>public List&lt;List&lt;Pojo&gt;&gt; getList() {
      return list;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>public class Destination {
      private final List> listDest = new LinkedList>();</p>
  
  <pre><code>public List&lt;List&lt;Pojo&gt;&gt; getListDest() {
      return listDest;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>public class Main {</p>
  
  <pre><code>public static void main(final String[] args) {
  
      final MapperFactory factory = new DefaultMapperFactory.Builder().build();
  
      factory.classMap(Source.class, Destination.class).field("list", "listDest").byDefault().register();
  
      final Source src = new Source();
      final LinkedList&lt;Pojo&gt; nestedList = new LinkedList&lt;Pojo&gt;();
      final Pojo pojo = new Pojo();
      pojo.setField(8978);
  
      nestedList.add(pojo);
  
      src.getList().add(nestedList);
  
      final MapperFacade facade = factory.getMapperFacade();
      final Destination dest = facade.map(src, Destination.class);
  
      System.out.println(dest.getListDest().get(0).get(0).getField());
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Execution above code results this Exception:</p>
  
  <pre><code>Exception in thread "main" ma.glasnost.orika.MappingException: Error encountered while mapping for the following inputs: 
  rawSource=com.bbh.nested.Source@39185ce6
  sourceClass=class com.bbh.nested.Source
  destinationClass=class com.bbh.nested.Destination
  </code></pre>