### Question:
PlayerResult implements Serializable { public static PlayerResult from(Sc2Api.PlayerResult sc2ApiPlayerResult) { require("sc2api player result", sc2ApiPlayerResult); return new PlayerResult(sc2ApiPlayerResult); } private  PlayerResult(Sc2Api.PlayerResult sc2ApiPlayerResult); static PlayerResult from(Sc2Api.PlayerResult sc2ApiPlayerResult); int getPlayerId(); Result getResult(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void throwsExceptionWhenSc2ApiPlayerResultIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> PlayerResult.from(nothing())) .withMessage("sc2api player result is required"); }
@Test void convertsAllFieldsFromSc2ApiPlayerResult() { assertThatAllFieldsAreConverted(PlayerResult.from(sc2ApiPlayerResult())); }
@Test void throwsExceptionWhenSc2ApiPlayerInfoDoesNotExist() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> PlayerResult.from(sc2ApiPlayerResultWithoutPlayerId())) .withMessage("player id is required"); }
@Test void throwsExceptionWhenSc2ApiResultDoesNotExist() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> PlayerResult.from(sc2PlayerResultWithoutResult())) .withMessage("result is required"); }