下面列出了org.apache.commons.lang3.tuple.ImmutableTriple#getLeft ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Test
public void generateTeamTriple() {
dataBasePopulator.createRandomMatches();
for (int i = 0; i < 100; i++) {
ImmutableTriple<Country, Country, Country> triple = randomValueGenerator.generateTeamTriple();
assertThat(triple).isNotNull();
Country countryOne = triple.getLeft();
Country countryTwo = triple.getMiddle();
Country countryThree = triple.getRight();
assertThat(countryOne).isNotNull();
assertThat(countryTwo).isNotNull();
assertThat(countryThree).isNotNull();
assertThat(countryOne).isNotEqualTo(countryTwo);
assertThat(countryTwo).isNotEqualTo(countryThree);
assertThat(countryThree).isNotEqualTo(countryOne);
assertThat(Country.NONE).isNotEqualTo(countryOne);
assertThat(Country.NONE).isNotEqualTo(countryTwo);
assertThat(Country.NONE).isNotEqualTo(countryThree);
}
}
public void createExtraBetForUser(String username) {
ImmutableTriple<Country, Country, Country> triple = randomValueGenerator.generateTeamTriple();
if (triple != null) {
Country extraBetCountryFinalWinner = triple.getLeft();
Country extraBetCountrySemiFinalWinner = triple.getMiddle();
Country extraBetCountryThirdFinalWinner = triple.getRight();
saveExtraBet(extraBetCountryFinalWinner, extraBetCountrySemiFinalWinner, extraBetCountryThirdFinalWinner,
username);
}
}