title: Mapstruct: Ignore some elements of a collection based on the value of one of their fields
body: <p>I have these beans:</p>
  <pre><code>public class Company {
      private String name;
      private List&lt;Address&gt; addresses;
      ...some other fields...
  }
  
  public class Address {
      private String street;
      private String city;
      private boolean deleted;
      ...some other fields...
  }
  </code></pre>
  <p>I also have some DTOs for those beans</p>
  <pre><code>public class CompanyDto {
      private String name;
      private List&lt;AddressDto&gt; addresses;
      ...some other fields...
  }
  
  public class AddressDto {
      private String street;
      private String city;
      ...some other fields...
  }
  </code></pre>
  <p>(Please note that the AddressDto class lacks the <code>deleted</code> field)</p>
  <p>I'm using Mapstruct to map those beans to their DTOs. The mapper is this:</p>
  <pre><code>@Mapper
  public interface CompanyMapper {
      CompanyDto companyToCompanyDto(Company company);
      List&lt;AddressDto&gt; ListAddressToListAddressDto(List&lt;Address&gt; addresses);
  }
  </code></pre>
  <p>Now, in the mapping I want to ignore the Address instances whose <code>deleted</code> field is <code>true</code>. Is there a way for me to achieve that?</p>