@Test public void testExecute() { MatchResult result1 = MatchResult.builder() .awayGoals(Collections.emptyList()) .homeGoals(Collections.singletonList(newGoal(10, clubA))) .build(clubA, clubB); MatchResult result2 = MatchResult.builder() .homeGoals(Collections.emptyList()) .awayGoals(Arrays.asList(newGoal(30, clubD), newGoal(40, clubD))) .build(clubC, clubD); Match match1 = Match.create(clubA, clubB, result1); Match match2 = Match.create(clubC, clubD, result2); executor.execute(Arrays.asList(match1, match2)); List<? extends Club> clubs = persistenceService.query(AutoValueClasses.CLUB); List<Club> query = Util.listSupertype(clubs); assertThat(query).containsOnly(clubA.newWithWin(1), clubB.newWithLoss(-1), clubC.newWithLoss(-2), clubD.newWithWin(2)); }
public void execute(List<Match> matches) { for (Club club : FluentIterable.from(matches).transformAndConcat(this::filterClubsByResult)) { Log.d(TAG, "Updating club " + club.abbrev_name() + " with stats " + club.stats()); persistenceService.update(club, club.id()); } }
LeagueRoundExecutor { public void execute(List<Match> matches) { for (Club club : FluentIterable.from(matches).transformAndConcat(this::filterClubsByResult)) { Log.d(TAG, "Updating club " + club.abbrev_name() + " with stats " + club.stats()); persistenceService.update(club, club.id()); } } }
LeagueRoundExecutor { public void execute(List<Match> matches) { for (Club club : FluentIterable.from(matches).transformAndConcat(this::filterClubsByResult)) { Log.d(TAG, "Updating club " + club.abbrev_name() + " with stats " + club.stats()); persistenceService.update(club, club.id()); } } LeagueRoundExecutor(ElifutDataStore persistenceService); }
LeagueRoundExecutor { public void execute(List<Match> matches) { for (Club club : FluentIterable.from(matches).transformAndConcat(this::filterClubsByResult)) { Log.d(TAG, "Updating club " + club.abbrev_name() + " with stats " + club.stats()); persistenceService.update(club, club.id()); } } LeagueRoundExecutor(ElifutDataStore persistenceService); void execute(List<Match> matches); }
LeagueRoundExecutor { public void execute(List<Match> matches) { for (Club club : FluentIterable.from(matches).transformAndConcat(this::filterClubsByResult)) { Log.d(TAG, "Updating club " + club.abbrev_name() + " with stats " + club.stats()); persistenceService.update(club, club.id()); } } LeagueRoundExecutor(ElifutDataStore persistenceService); void execute(List<Match> matches);  }