LeagueDetails { public int clubPosition(Club club) { List<? extends Club> sortedClubs = clubsStandings(); Optional<? extends Club> selectedClub = FluentIterable.from(sortedClubs) .firstMatch(c -> c.nameEquals(club)); return selectedClub.isPresent() ? sortedClubs.indexOf(selectedClub.get()) : -1; } 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 clubPosition() { when(mockPersistenceStore.query(AutoValueClasses.CLUB)).thenReturn( Arrays.asList(gremioWithWin, internacionalWithLoss, flamengoWithWin, fluminenseWithLoss)); LeagueDetails leagueDetails = new LeagueDetails(mockPersistenceStore, clubDataStore, roundGenerator, matchResultGenerator); assertThat(leagueDetails.clubPosition(gremioWithWin)).isEqualTo(0); assertThat(leagueDetails.clubPosition(flamengoWithWin)).isEqualTo(1); assertThat(leagueDetails.clubPosition(fluminenseWithLoss)).isEqualTo(2); assertThat(leagueDetails.clubPosition(internacionalWithLoss)).isEqualTo(3); }