### Question:
ResponseStartReplay extends Response { public static ResponseStartReplay from(Sc2Api.Response sc2ApiResponse) { if (!hasStartReplayResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have start replay response"); } return new ResponseStartReplay( sc2ApiResponse.getStartReplay(), sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } private  ResponseStartReplay(
            Sc2Api.ResponseStartReplay sc2ApiResponseStartReplay, Sc2Api.Status sc2ApiStatus, int id); static ResponseStartReplay from(Sc2Api.Response sc2ApiResponse); Optional<ResponseStartReplay.Error> getError(); Optional<String> getErrorDetails(); @Override boolean equals(Object o); @Override boolean canEqual(Object other); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void throwsExceptionWhenSc2ApiResponseDoesNotHaveStartReplay() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseStartReplay.from(nothing())) .withMessage("provided argument doesn't have start replay response"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseStartReplay.from(aSc2ApiResponse().build())) .withMessage("provided argument doesn't have start replay response"); }
@Test void convertsSc2ApiResponseStartReplayToResponseStartReplay() { ResponseStartReplay responseStartReplay = ResponseStartReplay.from(sc2ApiResponseWithStartReplay()); assertThatResponseDoesNotHaveError(responseStartReplay); assertThatResponseIsInValidState(responseStartReplay); }
@Test void throwsExceptionWhenResponseStartReplayErrorIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseStartReplay.Error.from(nothing())) .withMessage("sc2api response start replay error is required"); }