private Game createGame( Event event, Participant firstParticipant, Participant secondParticipant, Integer groupNumber) { Game game = new Game(); game.setEvent(event); if (groupNumber != null) { game.setGroupNumber(groupNumber); } Set<Participant> gameParticipants = new LinkedHashSet<>(); gameParticipants.add(firstParticipant); gameParticipants.add(secondParticipant); game.setParticipants(gameParticipants); game = gameDAO.saveOrUpdate(game); return game; }