### Question:
ResponseAction extends Response { public static ResponseAction from(Sc2Api.Response sc2ApiResponse) { if (!hasActionResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have action response"); } return new ResponseAction(sc2ApiResponse.getAction(), sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } private  ResponseAction(Sc2Api.ResponseAction sc2ApiResponseAction, Sc2Api.Status status, int id); static ResponseAction from(Sc2Api.Response sc2ApiResponse); List<ActionResult> getResults(); @Override boolean equals(Object o); @Override boolean canEqual(Object other); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void throwsExceptionWhenSc2ApiResponseDoesNotHaveAction() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseAction.from(nothing())) .withMessage("provided argument doesn't have action response"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseAction.from(aSc2ApiResponse().build())) .withMessage("provided argument doesn't have action response"); }
@Test void convertsSc2ApiResponseActionToResponseAction() { assertThatAllFieldsAreProperlyConverted(ResponseAction.from(sc2ApiResponseWithAction())); }