### Question:
BuildItem implements Serializable { public static BuildItem from(Ui.BuildItem sc2ApiBuildItem) { require("sc2api build item", sc2ApiBuildItem); return new BuildItem(sc2ApiBuildItem); } private  BuildItem(Ui.BuildItem sc2ApiBuildItem); static BuildItem from(Ui.BuildItem sc2ApiBuildItem); Ability getAbility(); float getBuildProgress(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void throwsExceptionWhenSc2ApiBuildItemIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> BuildItem.from(nothing())) .withMessage("sc2api build item is required"); }
@Test void convertsAllFieldsFromSc2ApiBuildItem() { assertThatAllFieldsAreConverted(BuildItem.from(sc2ApiBuildItem())); }
@Test void throwsExceptionWhenAbilityIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> BuildItem.from( without(() -> sc2ApiBuildItem().toBuilder(), Ui.BuildItem.Builder::clearAbilityId).build())) .withMessage("ability is required"); }
@Test void throwsExceptionWhenBuildProgressIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> BuildItem.from( without(() -> sc2ApiBuildItem().toBuilder(), Ui.BuildItem.Builder::clearBuildProgress).build())) .withMessage("build progress is required"); }