### Question:
AbilityData implements Serializable { public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } private  AbilityData(Data.AbilityData sc2ApiAbilityData); static AbilityData from(Data.AbilityData sc2ApiAbilityData); Ability getAbility(); String getLinkName(); int getLinkIndex(); Optional<String> getButtonName(); Optional<String> getFriendlyName(); Optional<String> getHotkey(); Optional<Ability> getRemapsToAbility(); boolean isAvailable(); Optional<Target> getTarget(); boolean isAllowMinimap(); boolean isAllowAutocast(); boolean isBuilding(); Optional<Float> getFootprintRadius(); boolean isInstantPlacement(); Optional<Float> getCastRange(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void throwsExceptionWhenSc2ApiAbilityDataIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> AbilityData.from(nothing())) .withMessage("sc2api ability data is required"); }
@Test void convertsAllFieldsFromSc2ApiUnit() { assertThatAllFieldsAreConverted(AbilityData.from(sc2ApiAbilityData())); }
@Test void throwsExceptionWhenAbilityIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> AbilityData.from(without( () -> sc2ApiAbilityData().toBuilder(), Data.AbilityData.Builder::clearAbilityId).build())) .withMessage("ability is required"); }
@Test void throwsExceptionWhenLinkNameIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> AbilityData.from(without( () -> sc2ApiAbilityData().toBuilder(), Data.AbilityData.Builder::clearLinkName).build())) .withMessage("link name is required"); }
@Test void throwsExceptionWhenLinkIndexIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> AbilityData.from(without( () -> sc2ApiAbilityData().toBuilder(), Data.AbilityData.Builder::clearLinkIndex).build())) .withMessage("link index is required"); }