### Question:
GcpComputeInstanceContainer extends Container { @ChaosExperiment(experimentType = ExperimentType.STATE, experimentScope = ExperimentScope.PET) public void stopInstance (Experiment experiment) { AtomicReference<String> operationId = new AtomicReference<>(); experiment.setCheckContainerHealth(() -> isOperationComplete(operationId) ? platform.isContainerRunning(this) : ContainerHealth.RUNNING_EXPERIMENT); experiment.setSelfHealingMethod(() -> platform.startInstance(this)); operationId.set(platform.stopInstance(this)); } private  GcpComputeInstanceContainer(); static GcpComputeInstanceContainerBuilder builder(); String getUniqueIdentifier(); @ChaosExperiment(experimentType = ExperimentType.STATE, experimentScope = ExperimentScope.CATTLE, maximumDurationInSeconds = 600) void recreateInstanceInGroup(Experiment experiment); String getInstanceName(); String getZone(); @Override Platform getPlatform(); @Override String getSimpleName(); @Override String getAggregationIdentifier(); @Override DataDogIdentifier getDataDogIdentifier(); @Override boolean isCattle(); @ChaosExperiment(experimentType = ExperimentType.NETWORK, experimentScope = ExperimentScope.PET) void removeNetworkTags(Experiment experiment); @ChaosExperiment(experimentType = ExperimentType.RESOURCE, maximumDurationInSeconds = 600) void simulateMaintenance(Experiment experiment); @ChaosExperiment(experimentType = ExperimentType.STATE, experimentScope = ExperimentScope.PET) void stopInstance(Experiment experiment); @ChaosExperiment(experimentType = ExperimentType.STATE, experimentScope = ExperimentScope.PET) void resetInstance(Experiment experiment); GcpSSHKeyMetadata getGcpSSHKeyMetadata(); void updateUUID(); SSHCredentials getSSHCredentials(); String getSSHEndpoint(); @Override boolean supportsShellBasedExperiments(); static final String DATADOG_IDENTIFIER_KEY; }### Answer:
@Test public void stopInstance () { container.stopInstance(experiment); verify(platform).stopInstance(container); verify(experiment).setSelfHealingMethod(any()); verify(experiment).setCheckContainerHealth(any()); }
@Test public void stopInstanceSelfHealing () { container.stopInstance(experiment); experiment.getSelfHealingMethod().run(); verify(platform).startInstance(container); }