EventMapper { public abstract List<EventApiEntity> toApiEntityList(List<Event> domainEntityList);  @Mappings({ @Mapping(source = "apiAddRequest.handicapGroupSetId", target = "handicapGroupSet"), @Mapping(source = "apiAddRequest.competitionGroupSetId", target = "competitionGroupSet") }) abstract EventAddPayload toDomainAddPayload(AddEventRequest apiAddRequest); @Mappings({ @Mapping(source = "domainEntity.handicapGroupSet.id", target = "handicapGroupSetId"), @Mapping(source = "domainEntity.competitionGroupSet.id", target = "competitionGroupSetId") }) abstract EventApiEntity toApiEntity(Event domainEntity); abstract List<EventApiEntity> toApiEntityList(List<Event> domainEntityList); abstract EventHibernateEntity toHibernateEntity(EventAddPayload domainAddPayload); EventHibernateEntity toHibernateEntity(Event domainEntity); abstract void updateHibernateEntity(
            Event domainEntity,
            @MappingTarget EventHibernateEntity hibernateEntity
    ); abstract Event toDomainEntity(EventHibernateEntity hibernateEntity); abstract List<Event> toDomainEntityList(List<EventHibernateEntity> hibernateEntityList); HandicapGroupSet toDomainHandicapGroupSet(String handicapGroupSetId); CompetitionGroupSet toDomainCompetitionGroupSet(String competitionGroupSetId); HandicapGroupSetHibernateEntity toHibernateEntity(HandicapGroupSet domainEntity); CompetitionGroupSetHibernateEntity toHibernateEntity(CompetitionGroupSet domainEntity); HandicapGroupSet toDomainEntity(HandicapGroupSetHibernateEntity hibernateEntity); CompetitionGroupSet toDomainEntity(CompetitionGroupSetHibernateEntity hibernateEntity); void setDao(EventDao dao); void setHandicapGroupSetMapper(HandicapGroupSetMapper handicapGroupSetMapper); void setHandicapGroupSetService(HandicapGroupSetService handicapGroupSetService); void setCompetitionGroupSetMapper(CompetitionGroupSetMapper competitionGroupSetMapper); void setCompetitionGroupSetService(CompetitionGroupSetService competitionGroupSetService);  }
@Test public void whenToApiEntitiesListFromDomainEntitiesList() { List<Event> domainEntityList = Arrays.asList(DomainEntityTestUtils.fullEvent()); List<EventApiEntity> expected = Arrays.asList(ApiEntityTestUtils.fullEvent()); List<EventApiEntity> actual = mapper.toApiEntityList(domainEntityList); assertThat(actual).isEqualTo(expected); }