### Question:
UnitTypeData implements Serializable { public static UnitTypeData from(Data.UnitTypeData sc2ApiUnitTypeData) { require("sc2api unit type data", sc2ApiUnitTypeData); return new UnitTypeData(sc2ApiUnitTypeData); } private  UnitTypeData(Data.UnitTypeData sc2ApiUnitTypeData); static UnitTypeData from(Data.UnitTypeData sc2ApiUnitTypeData); UnitType getUnitType(); String getName(); boolean isAvailable(); Optional<Integer> getCargoSize(); Optional<Integer> getMineralCost(); Optional<Integer> getVespeneCost(); Optional<Float> getFoodRequired(); Optional<Float> getFoodProvided(); Optional<Ability> getAbility(); Optional<Race> getRace(); Optional<Float> getBuildTime(); boolean isHasVespene(); boolean isHasMinerals(); Optional<Float> getSightRange(); Set<UnitType> getTechAliases(); Optional<UnitType> getUnitAlias(); Optional<UnitType> getTechRequirement(); boolean isRequireAttached(); Set<UnitAttribute> getAttributes(); Optional<Float> getMovementSpeed(); Optional<Float> getArmor(); Set<Weapon> getWeapons(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void throwsExceptionWhenSc2ApiUnitTypeDataIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> UnitTypeData.from(nothing())) .withMessage("sc2api unit type data is required"); }
@Test void convertsAllFieldsFromSc2ApiUnit() { assertThatAllFieldsAreConverted(UnitTypeData.from(sc2ApiUnitTypeData())); }
@Test void throwsExceptionWhenUnitTypeIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> UnitTypeData.from(without( () -> sc2ApiUnitTypeData().toBuilder(), Data.UnitTypeData.Builder::clearUnitId).build())) .withMessage("unit type is required"); }
@Test void throwsExceptionWhenNameIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> UnitTypeData.from(without( () -> sc2ApiUnitTypeData().toBuilder(), Data.UnitTypeData.Builder::clearName).build())) .withMessage("name is required"); }