### Question:
UnitOrder implements Serializable, GeneralizableAbility<UnitOrder> { public static UnitOrder from(Raw.UnitOrder sc2ApiUnitOrder) { require("sc2api unit order", sc2ApiUnitOrder); return new UnitOrder(sc2ApiUnitOrder); } private  UnitOrder(Raw.UnitOrder sc2ApiUnitOrder); private  UnitOrder(Ability ability, Tag targetedUnitTag, Point targetedWorldSpacePosition, Float progress); static UnitOrder from(Raw.UnitOrder sc2ApiUnitOrder); Ability getAbility(); Optional<Tag> getTargetedUnitTag(); Optional<Point> getTargetedWorldSpacePosition(); Optional<Float> getProgress(); @Override UnitOrder generalizeAbility(UnaryOperator<Ability> generalize); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void throwsExceptionWhenSc2ApiUnitOrderIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> UnitOrder.from(nothing())) .withMessage("sc2api unit order is required"); }
@Test void convertsAllFieldsFromSc2ApiUnitOrder() { assertThatAllFieldsAreConverted(UnitOrder.from(sc2ApiUnitOrder())); assertThatWorldSpacePositionInConvertedIfProvided( UnitOrder.from(sc2ApiUnitOrderWithTargetedWorldSpacePosition())); }
@Test void throwsExceptionWhenAbilityIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> UnitOrder.from( without(() -> sc2ApiUnitOrder().toBuilder(), Raw.UnitOrder.Builder::clearAbilityId).build())) .withMessage("ability is required"); }