### Question:
ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand(sc2ApiActionRawUnitCommand); } private  ActionRawUnitCommand(Builder builder); private  ActionRawUnitCommand(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand); static ActionRawUnitCommandSyntax unitCommand(); static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand); @Override Raw.ActionRawUnitCommand toSc2Api(); Ability getAbility(); Optional<Tag> getTargetedUnitTag(); Optional<Point2d> getTargetedWorldSpacePosition(); Set<Tag> getUnitTags(); boolean isQueued(); @Override ActionRawUnitCommand generalizeAbility(UnaryOperator<Ability> generalize); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void throwsExceptionWhenSc2ApiActionRawUnitCommandIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ActionRawUnitCommand.from(nothing())) .withMessage("sc2api action raw unit command is required"); }
@Test void convertsSc2ApiActionRawUnitCommandToActionRawUnitCommand() { assertThatAllFieldsAreConverted(ActionRawUnitCommand.from(sc2ApiActionRawUnitCommand())); }
@Test void throwsExceptionWhenAbilityIdIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ActionRawUnitCommand.from(sc2ApiActionRawUnitCommandWithoutAbilityId())) .withMessage("ability id is required"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> unitCommandBuilder().build()) .withMessage("ability id is required"); }
@Test void throwsExceptionIfUnitTagSetIsEmpty() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ActionRawUnitCommand.from(without( () -> sc2ApiActionRawUnitCommand().toBuilder(), Raw.ActionRawUnitCommand.Builder::clearUnitTags).build())) .withMessage("unit tag list is required"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> unitCommandBuilder().useAbility(Abilities.ATTACK).build()) .withMessage("unit tag list is required"); }
@Test void serializesOnlyRecentlyAddedTarget() { assertCorrectTarget(fullAccessTo(defaultUnitCommand().target(Tag.from(UNIT_TAG))) .target(Point2d.of(10, 20)).build()); assertCorrectTargetAfterOrderChange(fullAccessTo(defaultUnitCommand().target(Point2d.of(10, 20))) .target(Tag.from(UNIT_TAG)).build()); }