title: Mapstruct 1.3.0.Final version is generating wrong code generation for optional collection getter fields
body: <p>We have a POJO class with Optional getter fields. The mapstruct 1.3.0.Final generating wrong code for the Optional collection field.</p>
  <p>We have ProgramAggregate POJO which contains Collection of Program (Collection) and it is an Optional getter type.</p>
  <p>When we run with mapstruct 1.2.0.Final, we are seeing proper code generation.
  But the same code with 1.3.0.Final generating wrong code. It is not generating the Collection mapping method for Optional Collection getter methods.
  <a href="https://i.stack.imgur.com/xQlPj.jpg" rel="nofollow noreferrer">Generated code image</a></p>
  <pre><code>@Data
  @NoArgsConstructor
  @ToString(callSuper = true)
  @FieldDefaults(makeFinal = false, level = AccessLevel.PRIVATE)
  public class ProgramAggregate {
      public static final long serialVersionUID = 1L;
  
      Collection&lt;Program&gt; programs;
  
      public Optional&lt;Collection&lt;Program&gt;&gt; getPrograms() {
          return Optional.ofNullable(programs);
      }
  
  
  }
  
  
  @Data
  @NoArgsConstructor
  @FieldDefaults(makeFinal = false, level = AccessLevel.PRIVATE)
  @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = &quot;_type&quot;)
  public class Program {
      String name;
      String number;
  
  
      public Optional&lt;String&gt; getName() {
          return Optional.ofNullable(name);
      }
  
      public Optional&lt;String&gt; getNumber() {
          return Optional.ofNullable(number);
      }
  
  }
  
  
  @Data
  @NoArgsConstructor
  @FieldDefaults(makeFinal = false, level = AccessLevel.PRIVATE)
  public class ProgramResponseDto {
      Collection&lt;ProgramDto&gt; programs;
  
      public Optional&lt;Collection&lt;ProgramDto&gt;&gt; getPrograms() {
          return Optional.ofNullable(programs);
      }
  
  }
  
  @Data
  @NoArgsConstructor
  @FieldDefaults(makeFinal = false, level = AccessLevel.PRIVATE)
  @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = &quot;_type&quot;)
  public class ProgramDto {
      String name;
      String number;
      String oldNumber;
  
      public Optional&lt;String&gt; getName() {
          return Optional.ofNullable(name);
      }
  
      public Optional&lt;String&gt; getNumber() {
          return Optional.ofNullable(number);
      }
  
      public Optional&lt;String&gt; getOldNumber() {
          return Optional.ofNullable(oldNumber);
      }
  
  }
  
  @Mapper(nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, unmappedTargetPolicy = ReportingPolicy.WARN,
          collectionMappingStrategy = CollectionMappingStrategy.TARGET_IMMUTABLE)
  public interface IProgramMapper extends IOptionalMapper, IDefaultMapper {
      ProgramResponseDto map(ProgramAggregate programAggregate);
  
      ProgramDto map(Program sourceProgramDto);
  
      Collection&lt;ProgramDto&gt; mapPrograms(Collection&lt;Program&gt; sourcePrograms);
  
  
  
  }
  </code></pre>
  <p>Result:</p>
  <pre><code>@Generated(
      value = &quot;org.mapstruct.ap.MappingProcessor&quot;,
      date = &quot;2020-10-12T13:10:32+0530&quot;,
      comments = &quot;version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_231 (Oracle Corporation)&quot;
  )
  public class IProgramMapperImpl implements IProgramMapper {
  
      @Override
      public ProgramResponseDto map(ProgramAggregate programAggregate) {
          if ( programAggregate == null ) {
              return null;
          }
  
          ProgramResponseDto programResponseDto = new ProgramResponseDto();
  
          **Collection&lt;ProgramDto&gt; collection = fromOptional( programAggregate.getPrograms() );**
          if ( collection != null ) {
              programResponseDto.setPrograms( collection );
          }
  
          return programResponseDto;
      }
  
      @Override
      public ProgramDto map(Program sourceProgramDto) {
          if ( sourceProgramDto == null ) {
              return null;
          }
  
          ProgramDto programDto = new ProgramDto();
  
          if ( sourceProgramDto.getName() != null ) {
              programDto.setName( fromOptional( sourceProgramDto.getName() ) );
          }
          if ( sourceProgramDto.getNumber() != null ) {
              programDto.setNumber( fromOptional( sourceProgramDto.getNumber() ) );
          }
  
          return programDto;
      }
  
      @Override
      public Collection&lt;ProgramDto&gt; mapPrograms(Collection&lt;Program&gt; sourcePrograms) {
          if ( sourcePrograms == null ) {
              return null;
          }
  
          Collection&lt;ProgramDto&gt; collection = new ArrayList&lt;ProgramDto&gt;( sourcePrograms.size() );
          for ( Program program : sourcePrograms ) {
              collection.add( map( program ) );
          }
  
          return collection;
      }
  }
  </code></pre>
  <p>Below is the error after maven build.
  Error:</p>
  <p><strong>[ERROR] //mapstruct_latest_example/target/generated-sources/annotations/IProgramMapperImpl.java:[21,57] incompatible types: inference variable T has incompatible bounds</strong>
  [ERROR]     equality constraints: java.util.Collection
  [ERROR]     upper bounds: java.util.Collection,java.lang.Object</p>