### Question:
ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { @Override public Raw.ActionRaw toSc2Api() { Raw.ActionRaw.Builder aSc2ApiActionRaw = Raw.ActionRaw.newBuilder(); getUnitCommand().map(ActionRawUnitCommand::toSc2Api).ifPresent(aSc2ApiActionRaw::setUnitCommand); getCameraMove().map(ActionRawCameraMove::toSc2Api).ifPresent(aSc2ApiActionRaw::setCameraMove); getToggleAutocast().map(ActionRawToggleAutocast::toSc2Api).ifPresent(aSc2ApiActionRaw::setToggleAutocast); return aSc2ApiActionRaw.build(); } private  ActionRaw(Raw.ActionRaw sc2ApiActionRaw); private  ActionRaw(ActionRawUnitCommand unitCommand); private  ActionRaw(ActionRawCameraMove cameraMove); private  ActionRaw(ActionRawToggleAutocast toggleAutocast); static ActionRaw from(Raw.ActionRaw sc2ApiActionRaw); static ActionRaw of(ActionRawUnitCommand unitCommand); static ActionRaw of(ActionRawCameraMove cameraMove); static ActionRaw of(ActionRawToggleAutocast toggleAutocast); @Override Raw.ActionRaw toSc2Api(); Optional<ActionRawUnitCommand> getUnitCommand(); Optional<ActionRawCameraMove> getCameraMove(); Optional<ActionRawToggleAutocast> getToggleAutocast(); @Override ActionRaw generalizeAbility(UnaryOperator<Ability> generalize); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void serializesToSc2ApiActionRawWithToggleAutocast() { Raw.ActionRaw sc2ApiActionRaw = actionRawWithToggleAutocast().toSc2Api(); assertThat(sc2ApiActionRaw.hasToggleAutocast()).as("sc2api action raw: case of action is toggle autocast") .isTrue(); assertThat(sc2ApiActionRaw.hasCameraMove()).as("sc2api action raw: case of action is camera move").isFalse(); assertThat(sc2ApiActionRaw.hasUnitCommand()).as("sc2api action raw: case of action is unit command").isFalse(); }
@Test void serializesToSc2ApiActionRawWithUnitCommand() { Raw.ActionRaw sc2ApiActionRaw = actionRawWithUnitCommand().toSc2Api(); assertThat(sc2ApiActionRaw.hasToggleAutocast()).as("sc2api action raw: case of action is toggle autocast") .isFalse(); assertThat(sc2ApiActionRaw.hasCameraMove()).as("sc2api action raw: case of action is camera move").isFalse(); assertThat(sc2ApiActionRaw.hasUnitCommand()).as("sc2api action raw: case of action is unit command").isTrue(); }
@Test void serializesToSc2ApiActionRawWithCameraMove() { Raw.ActionRaw sc2ApiActionRaw = actionRawWithCameraMove().toSc2Api(); assertThat(sc2ApiActionRaw.hasToggleAutocast()).as("sc2api action raw: case of action is toggle autocast") .isFalse(); assertThat(sc2ApiActionRaw.hasCameraMove()).as("sc2api action raw: case of action is camera move").isTrue(); assertThat(sc2ApiActionRaw.hasUnitCommand()).as("sc2api action raw: case of action is unit command").isFalse(); }