@Test public void testSave() throws ValidationException { final Experiment experiment = experiments.create("foo").save(); verify(store).save(eq(experiment)); verifyZeroInteractions(cache); }
public void save(Experiment experiment) throws ValidationException { experiment.validateName(); experiment.getTreatments().forEach(Treatment::validateName); experiment.getOverrides().forEach(TreatmentOverride::validateName); store.save(experiment); strategy.onSave(experiment, context); }
Experiments implements Closeable { public void save(Experiment experiment) throws ValidationException { experiment.validateName(); experiment.getTreatments().forEach(Treatment::validateName); experiment.getOverrides().forEach(TreatmentOverride::validateName); store.save(experiment); strategy.onSave(experiment, context); } }
Experiments implements Closeable { public void save(Experiment experiment) throws ValidationException { experiment.validateName(); experiment.getTreatments().forEach(Treatment::validateName); experiment.getOverrides().forEach(TreatmentOverride::validateName); store.save(experiment); strategy.onSave(experiment, context); } private  Experiments(ExperimentsStoreProvider provider,
                        CacheStrategy strategy,
                        ExecutorService executorService); }
Experiments implements Closeable { public void save(Experiment experiment) throws ValidationException { experiment.validateName(); experiment.getTreatments().forEach(Treatment::validateName); experiment.getOverrides().forEach(TreatmentOverride::validateName); store.save(experiment); strategy.onSave(experiment, context); } private  Experiments(ExperimentsStoreProvider provider,
                        CacheStrategy strategy,
                        ExecutorService executorService); static Builder using(ExperimentsStoreProvider provider); Treatment getActiveTreatment(String experimentName, Identity identity); Iterable<Experiment> getActiveExperiments(); Map<Experiment, Treatment> getActiveTreatments(Identity identity); Iterable<Experiment> find(Filter filter); Iterable<Experiment> find(); Experiment get(String experimentName); void delete(String experimentName); void save(Experiment experiment); Experiment create(String name); @Override void close(); }
Experiments implements Closeable { public void save(Experiment experiment) throws ValidationException { experiment.validateName(); experiment.getTreatments().forEach(Treatment::validateName); experiment.getOverrides().forEach(TreatmentOverride::validateName); store.save(experiment); strategy.onSave(experiment, context); } private  Experiments(ExperimentsStoreProvider provider,
                        CacheStrategy strategy,
                        ExecutorService executorService); static Builder using(ExperimentsStoreProvider provider); Treatment getActiveTreatment(String experimentName, Identity identity); Iterable<Experiment> getActiveExperiments(); Map<Experiment, Treatment> getActiveTreatments(Identity identity); Iterable<Experiment> find(Filter filter); Iterable<Experiment> find(); Experiment get(String experimentName); void delete(String experimentName); void save(Experiment experiment); Experiment create(String name); @Override void close();  }