LeagueDetails { public LeagueRound nextRound() { if (!haveRoundsLeft()) { throw new IllegalStateException("No more rounds left"); } List<? extends LeagueRound> nextRounds = rounds(); LeagueRound nextRound = nextRounds.remove(0); service.delete(nextRound, nextRound.id()); return nextRound; } LeagueDetails(ElifutDataStore persistenceService, ClubDataStore clubDataStore,
      LeagueRoundGenerator leagueRoundGenerator, MatchResultGenerator generator); void initialize(List<? extends Club> allClubs); LeagueRound nextRound(); boolean haveRoundsLeft(); int clubPosition(Club club); LeagueRound executeRound(LeagueRound round); Observable<? extends List<? extends Club>> clubsObservable(); Observable<? extends List<? extends LeagueRound>> roundsObservable(); List<? extends Club> clubs(); List<? extends LeagueRound> rounds();  }
@Test public void testNextRound() { when(roundGenerator.generateRounds(clubs)).thenReturn(rounds); leagueDetails.initialize(clubs); assertThat(leagueDetails.nextRound()).isEqualTo(round1); assertThat(leagueDetails.rounds()).isEqualTo(Collections.singletonList(round2)); assertThat(leagueDetails.nextRound()).isEqualTo(round2); assertThat(leagueDetails.rounds()).isEqualTo(emptyList()); }