### Question:
GeneralUtil { public Round getRoundByRoundNum(Integer roundNum, Set<Round> roundList) throws Exception { for (Round round: roundList){ if (round.getRoundNumber().equals(roundNum)) { return round; } } throw new Exception("This should not happen hopefully..."); }  Round getRoundByRoundNum(Integer roundNum, Set<Round> roundList); Set<QuestionAnswer> getQuestionAnswers(Game game);  }### Answer:
@Test(expected = Exception.class) public void givenAnInvalidRoundNumber_whenCallingGetRoundByRoundNum_thenExpectAnException() throws Exception { Set<Round> rounds = new HashSet<>(); for (int i = 1; i <= 3; i++) { Round round = new Round(); round.setRoundNumber(i); rounds.add(round); } generalUtil.getRoundByRoundNum(4, rounds); }
@Test public void givenAValidRoundNumber_whenCallingGetRoundByRoundNum_thenItReturnsTheCorrectRound() throws Exception { Set<Round> rounds = new HashSet<>(); Round expectedRound = new Round(); expectedRound.setRoundNumber(4); rounds.add(expectedRound); for (int i = 1; i <= 3; i++) { Round round = new Round(); round.setRoundNumber(i); rounds.add(round); } Round returnedRound = generalUtil.getRoundByRoundNum(4, rounds); assertEquals(expectedRound, returnedRound); assertEquals(4, (int) returnedRound.getRoundNumber()); }