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