### Question:
ResponseDebug extends Response { public static ResponseDebug from(Sc2Api.Response sc2ApiResponse) { if (!hasDebugResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have debug response"); } return new ResponseDebug(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } private  ResponseDebug(Sc2Api.Status sc2ApiStatus, int id); static ResponseDebug from(Sc2Api.Response sc2ApiResponse); @Override boolean equals(Object o); @Override boolean canEqual(Object other); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void throwsExceptionWhenSc2ApiResponseDoesNotHaveDebug() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseDebug.from(nothing())) .withMessage("provided argument doesn't have debug response"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseDebug.from(aSc2ApiResponse().build())) .withMessage("provided argument doesn't have debug response"); }
@Test void convertsSc2ApiResponseDebugToResponseDebug() { ResponseDebug responseDebug = ResponseDebug.from(sc2ApiResponseWithDebug()); assertThat(responseDebug).as("converted response debug").isNotNull(); assertThat(responseDebug.getType()).as("type of debug response") .isEqualTo(ResponseType.DEBUG); assertThat(responseDebug.getStatus()).as("status of debug response").isEqualTo(GameStatus.IN_GAME); }