### Question:
DamageBonus implements Serializable { public static DamageBonus from(Data.DamageBonus sc2ApiDamageBonus) { require("sc2api damage bonus", sc2ApiDamageBonus); return new DamageBonus(sc2ApiDamageBonus); } private  DamageBonus(Data.DamageBonus sc2ApiDamageBonus); static DamageBonus from(Data.DamageBonus sc2ApiDamageBonus); UnitAttribute getAttribute(); float getBonus(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void throwsExceptionWhenSc2ApiDamageBonusIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> DamageBonus.from(nothing())) .withMessage("sc2api damage bonus is required"); }
@Test void convertsAllFieldsFromSc2ApiDamageBonus() { assertThatAllFieldsAreConverted(DamageBonus.from(sc2ApiDamageBonus())); }
@Test void throwsExceptionWhenAttributeIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> DamageBonus.from(without( () -> sc2ApiDamageBonus().toBuilder(), Data.DamageBonus.Builder::clearAttribute).build())) .withMessage("attribute is required"); }
@Test void throwsExceptionWhenBonusIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> DamageBonus.from(without( () -> sc2ApiDamageBonus().toBuilder(), Data.DamageBonus.Builder::clearBonus).build())) .withMessage("bonus is required"); }