title: Modelmapper: Map an element in a list to field in POJO
body: <pre><code>public class SimpleDTO{
      private String firstElement;
      private String lastElement;
  }
  
  public class ComplexSource{
      private List&lt;String&gt; elementList;
  }
  </code></pre>
  
  <p>I tried to map it using<code>map().setFirstElement(source.getElementList().get(0))</code> but I get an error stating "1) Invalid source method java.util.List.get(). Ensure that method has zero parameters and does not return void." </p>
  
  <p>How do I map an element in a list to a field in a Pojo using ModelMapper or any other alternative? </p>