### Question:
Container implements ExperimentalObject { public void startExperiment (Experiment experiment) { containerHealth = ContainerHealth.RUNNING_EXPERIMENT; log.info("Starting a experiment {} against container {}", experiment.getId(), this); experimentWithAnnotation(experiment); }  Map<String, Boolean> getShellCapabilities(); @JsonIgnore Map<String, String> getDataDogTags(); @Override boolean canExperiment(); @JsonIgnore abstract Platform getPlatform(); boolean eligibleForExperiments(); Experiment createExperiment(); @Override boolean equals(Object o); @Override int hashCode(); long getIdentity(); @Override String toString(); ContainerHealth getContainerHealth(ExperimentType experimentType); Experiment createExperiment(String experimentMethod); void startExperiment(Experiment experiment); abstract String getSimpleName(); abstract String getAggregationIdentifier(); String getContainerType(); @JsonIgnore Duration getMinimumSelfHealingInterval(); @JsonIgnore abstract DataDogIdentifier getDataDogIdentifier(); boolean compareUniqueIdentifier(String uniqueIdentifier); void setMappedDiagnosticContext(); void clearMappedDiagnosticContext(); @JsonIgnore List<Method> getExperimentMethods(); @SuppressWarnings("unchecked") Runnable recycleCattle(); boolean isCattle(); boolean supportsShellBasedExperiments(); @SuppressWarnings("unchecked") ShellOutput runCommand(String command); @JsonIgnore Boolean isContainerRecycled(); @SuppressWarnings("unchecked") String runScript(Script script); Instant getExperimentStartTime(); Collection<String> getKnownMissingCapabilities(); void clearExperiment(); boolean supportsExperimentScope(ExperimentScope experimentScope);  }### Answer:
@Test @SuppressWarnings("unchecked") public void startExperiment () { ExperimentMethod experimentMethod = mock(ExperimentMethod.class); Experiment experiment = mock(Experiment.class); doReturn(experimentMethod).when(experiment).getExperimentMethod(); testContainer.startExperiment(experiment); verify(experimentMethod).accept(testContainer, experiment); }
@Test @SuppressWarnings("unchecked") public void startExperimentException () { ExperimentMethod experimentMethod = mock(ExperimentMethod.class); Experiment experiment = mock(Experiment.class); RuntimeException experimentException = new RuntimeException(); doReturn(experimentMethod).when(experiment).getExperimentMethod(); doThrow(experimentException).when(experimentMethod).accept(testContainer, experiment); try { testContainer.startExperiment(experiment); fail("Exception expected"); } catch (ChaosException e) { verify(experimentMethod).accept(testContainer, experiment); assertSame(experimentException, e.getCause()); assertThat(e.getMessage(), Matchers.startsWith("12001")); } }