### Question:
ResponseQuitGame extends Response { public static ResponseQuitGame from(Sc2Api.Response sc2ApiResponse) { if (!hasQuitResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quit response"); } return new ResponseQuitGame(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } private  ResponseQuitGame(Sc2Api.Status sc2ApiStatus, int id); static ResponseQuitGame from(Sc2Api.Response sc2ApiResponse); @Override boolean equals(Object o); @Override boolean canEqual(Object other); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void throwsExceptionWhenSc2ApiResponseDoesNotHaveQuitGame() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseQuitGame.from(nothing())) .withMessage("provided argument doesn't have quit response"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseQuitGame.from(aSc2ApiResponse().build())) .withMessage("provided argument doesn't have quit response"); }
@Test void convertsSc2ApiResponseQuitGameToResponseQuitGame() { ResponseQuitGame responseQuitGame = ResponseQuitGame.from(sc2ApiResponseWithQuit()); assertThat(responseQuitGame).as("converted response quit game").isNotNull(); assertThat(responseQuitGame.getType()).as("type of quit game response") .isEqualTo(ResponseType.QUIT_GAME); assertThat(responseQuitGame.getStatus()).as("status of quit game response").isEqualTo(GameStatus.QUIT); }