@Test
public void testValidateOnSave() {

    final Treatment treatment = mock(Treatment.class);
    final TreatmentOverride override = mock(TreatmentOverride.class);
    final Experiment experiment = mock(Experiment.class);
    doReturn(Collections.singletonList(treatment)).when(experiment).getTreatments();
    doReturn(Collections.singletonList(override)).when(experiment).getOverrides();
    experiments.save(experiment);
    verify(experiment).validateName();
    verify(treatment).validateName();
    verify(override).validateName();
}