BaseballGame implements Game { @Override public String playGame() { return Math.random() < 0.5 ? getHomeTeam().getName() : getAwayTeam().getName(); } BaseballGame();  BaseballGame(Team homeTeam, Team awayTeam); @PostConstruct void startGame(); @PreDestroy void endGame(); void setDataSource(DataSource dataSource); void setHomeTeam(Team homeTeam); @Override Team getHomeTeam(); void setAwayTeam(Team awayTeam); @Override Team getAwayTeam(); @Override String playGame(); @Override String toString();  }
@Test public void testPlayGame() throws Exception { String home = game.getHomeTeam().getName(); String away = game.getAwayTeam().getName(); String result = game.playGame(); assertTrue(result.contains(home) || result.contains(away)); }