@Test
public void itShouldSaveMultipleSetsAssociatedToSameCompetitionGroup() {

    daoTestRule.inTransaction(() -> {
        // create and store an entity
        CompetitionGroupHibernateEntity entity = HibernateEntityTestUtils.fullCompetitionGroup();
        entity.setId(null);
        entityDao.create(entity);
        // create and store a set1
        CompetitionGroupSetHibernateEntity setEntity1 = HibernateEntityTestUtils.fullCompetitionGroupSet();
        setEntity1.setId(null);
        setEntity1.setCompetitionGroups(Sets.newHashSet());
        setDao.create(setEntity1);
        // create and store a set2
        CompetitionGroupSetHibernateEntity setEntity2 = HibernateEntityTestUtils.fullCompetitionGroupSet();
        setEntity2.setId(null);
        setEntity2.setCompetitionGroups(Sets.newHashSet());
        setDao.create(setEntity2);
        assertThat(setEntity1.getId()).isNotEqualTo(setEntity2.getId()); // sanity check
        // add entity to both sets and update
        setEntity1.getCompetitionGroups().add(entity);
        setEntity2.getCompetitionGroups().add(entity);
        setDao.update(setEntity1);
        setDao.update(setEntity2);
    });
}