### Question:
AwsEC2Container extends AwsContainer { boolean isStarted () { return awsEC2Platform.isStarted(this); } private  AwsEC2Container(); static AwsEC2ContainerBuilder builder(); String getInstanceId(); String getGroupIdentifier(); String getKeyName(); String getName(); boolean isSSHCapable(); String getImageId(); @Override Platform getPlatform(); @Override boolean eligibleForExperiments(); @Override String getSimpleName(); @Override String getAggregationIdentifier(); @Override DataDogIdentifier getDataDogIdentifier(); @Override boolean isCattle(); @Override boolean supportsShellBasedExperiments(); @ChaosExperiment(experimentType = ExperimentType.STATE) void stopContainer(Experiment experiment); @ChaosExperiment(experimentType = ExperimentType.STATE) void restartContainer(Experiment experiment); @ChaosExperiment(experimentType = ExperimentType.STATE, experimentScope = ExperimentScope.CATTLE) void terminateASGContainer(Experiment experiment); @ChaosExperiment(experimentType = ExperimentType.NETWORK) void removeSecurityGroups(Experiment experiment); String getRoutableAddress(); String getPublicAddress();  }### Answer:
@Test public void isStarted () { for (boolean result : List.of(true, false, true, false, true, false)) { doReturn(result).when(awsEC2Platform).isStarted(awsEC2Container); assertEquals(result, awsEC2Container.isStarted()); } }
@Test public void canExperiment () { doReturn(0D, 0D, 0D, 0.2D).when(awsEC2Platform).getDestructionProbability(); doReturn(true).when(awsEC2Platform).isStarted(awsEC2Container); do { verify(awsEC2Platform, never()).isStarted(awsEC2Container); } while (!awsEC2Container.canExperiment()); verify(awsEC2Platform, times(1)).isStarted(awsEC2Container); }