### Question:
ResponseData extends Response { public static ResponseData from(Sc2Api.Response sc2ApiResponse) { if (!hasDataResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have data response"); } return new ResponseData(sc2ApiResponse.getData(), sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } private  ResponseData(Sc2Api.ResponseData sc2ApiResponseData, Sc2Api.Status status, int id); static ResponseData from(Sc2Api.Response sc2ApiResponse); Set<AbilityData> getAbilities(); Set<UnitTypeData> getUnitTypes(); Set<UpgradeData> getUpgrades(); Set<BuffData> getBuffs(); Set<EffectData> getEffects(); @Override boolean equals(Object o); @Override boolean canEqual(Object other); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void throwsExceptionWhenSc2ApiResponseDoesNotHaveData() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseData.from(nothing())) .withMessage("provided argument doesn't have data response"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseData.from(aSc2ApiResponse().build())) .withMessage("provided argument doesn't have data response"); }
@Test void convertsSc2ApiResponseDataToResponseData() { assertThatAllFieldsAreProperlyConverted(ResponseData.from(sc2ApiResponseWithData())); }