@Test public void loadTeams() { TeamGameConfig teamGameConfig = mock(TeamGameConfig.class); Teams teams = mock(Teams.class); TeamLoader teamLoader = new TeamLoader(teamGameConfig, teams); TeamConfig config = mock(TeamConfig.class); when(config.getColor()).thenReturn(DyeColor.BLACK); when(config.getName()).thenReturn("name"); when(teamGameConfig.getTeamSize()).thenReturn(4); when(teamGameConfig.getTeams()).thenReturn(Collections.singletonList(config)); teamLoader.loadTeams(); verify(teams).addTeam(argThat( team -> team.getName().equals("name") && team.getColor().equals(DyeColor.BLACK))); }
public void loadTeams() { this.teamGameConfig .getTeams() .stream() .map(this::mapSingleTeamConfig) .forEach(teams::addTeam); }
TeamLoader { public void loadTeams() { this.teamGameConfig .getTeams() .stream() .map(this::mapSingleTeamConfig) .forEach(teams::addTeam); } }
TeamLoader { public void loadTeams() { this.teamGameConfig .getTeams() .stream() .map(this::mapSingleTeamConfig) .forEach(teams::addTeam); }  }
TeamLoader { public void loadTeams() { this.teamGameConfig .getTeams() .stream() .map(this::mapSingleTeamConfig) .forEach(teams::addTeam); }  void loadTeams(); }
TeamLoader { public void loadTeams() { this.teamGameConfig .getTeams() .stream() .map(this::mapSingleTeamConfig) .forEach(teams::addTeam); }  void loadTeams();  }