title: ModelMapper handling java 8 Optional<MyObjectDto> fields to Optional<MyObject>
body: <p>I've been using modelmapper and java 8 Optionals all around the application which was working fine because they were primitive types; until I changed one of my model objects' field to Optional type. Then all hell broke loose. Turns out many libraries cannot handle generics very well.</p>
  
  <p>Here is the structure</p>
  
  <pre><code>public class MyObjectDto
  {
     private Optional&lt;MySubObjectDto&gt; mySubObject;
  }
  
  public MyObject
  {
     privae Optional&lt;MySubjObject&gt; mySubObject;
  }
  </code></pre>
  
  <p>When I attempt to map <code>MyObjectDto</code> to <code>MyObject</code>, modelmapper calls </p>
  
  <pre><code>public void setMySubObject(Optional&lt;MySubObject&gt; mySubObject){
     this.mySubObject = mySubObject;
  }
  </code></pre>
  
  <p>with <code>Optional&lt;MySubObjectDto&gt;</code>, which I don't understand how that's even possible (there is no inheritance between them). Of course that crashes fast. For now I've changed my setters to accept Dto type just to survive the day but that's not going to work on the long run. Is there a better way to get around this, or shall I create an issue?</p>