@Test
/**
 *@see https://github.com/caeos/coner-core/issues/172
 */
public void testIssue172() throws EntityNotFoundException, AddEntityException {

    CompetitionGroupSetAddPayload payload = mock(CompetitionGroupSetAddPayload.class);
    CompetitionGroup domainEntity = DomainEntityTestUtils.fullCompetitionGroup();
    when(payload.getCompetitionGroupIds()).thenReturn(Sets.newHashSet(domainEntity.getId()));
    when(competitionGroupEntityService.getById(domainEntity.getId())).thenReturn(domainEntity);
    CompetitionGroupSet domainSetEntity = mock(CompetitionGroupSet.class);
    when(gateway.add(payload)).thenReturn(domainSetEntity);
    CompetitionGroupSet actual = service.add(payload);
    verify(payload).setCompetitionGroups(
            argThat(argument -> argument.contains(domainEntity))
    );
    verify(gateway).add(payload);
    assertThat(actual).isSameAs(domainSetEntity);
}