### Question:
ComputerPlayerSetup extends PlayerSetup { public static ComputerPlayerSetup computer(Race race, Difficulty difficulty) { if (race == null) throw new IllegalArgumentException("race is required"); if (difficulty == null) throw new IllegalArgumentException("difficulty level is required"); return new ComputerPlayerSetup(race, difficulty, null, null); } private  ComputerPlayerSetup(Race race, Difficulty difficulty, String playerName, AiBuild aiBuild); static ComputerPlayerSetup computer(Race race, Difficulty difficulty); static ComputerPlayerSetup computer(Race race, Difficulty difficulty, String playerName); static ComputerPlayerSetup computer(Race race, Difficulty difficulty, String playerName, AiBuild aiBuild); static ComputerPlayerSetup computer(Race race, Difficulty difficulty, AiBuild aiBuild); @Override Sc2Api.PlayerSetup toSc2Api(); Race getRace(); Difficulty getDifficulty(); Optional<String> getPlayerName(); Optional<AiBuild> getAiBuild(); @Override boolean equals(Object o); @Override boolean canEqual(Object other); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void throwsExceptionWhenRaceIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> computer(nothing(), Difficulty.MEDIUM)) .withMessage("race is required"); }
@Test void throwsExceptionWhenDifficultyIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> computer(Race.PROTOSS, nothing())) .withMessage("difficulty level is required"); }