@Test public void itDoesNotThrowOnMatch() throws Exception { Integer val = new Experiment<Integer>("test", true, new NoopMetricsProvider()) .run(this::safeFunction, this::safeFunction); assertThat(val).isEqualTo(3); }
public T run(Callable<T> control, Callable<T> candidate) throws Exception { if (isAsync()) { return runAsync(control, candidate); } else { return runSync(control, candidate); } }
Experiment { public T run(Callable<T> control, Callable<T> candidate) throws Exception { if (isAsync()) { return runAsync(control, candidate); } else { return runSync(control, candidate); } } }
Experiment { public T run(Callable<T> control, Callable<T> candidate) throws Exception { if (isAsync()) { return runAsync(control, candidate); } else { return runSync(control, candidate); } } Experiment(MetricsProvider<?> metricsProvider);  Experiment(String name, MetricsProvider<?> metricsProvider);  Experiment(String name, Map<String, Object> context, MetricsProvider<?> metricsProvider);  Experiment(String name, boolean raiseOnMismatch, MetricsProvider<?> metricsProvider);  Experiment(String name, Map<String, Object> context, boolean raiseOnMismatch, MetricsProvider<?> metricsProvider);  Experiment(String name, Map<String, Object> context, boolean raiseOnMismatch,
                      MetricsProvider<?> metricsProvider, BiFunction<T, T, Boolean> comparator);  Experiment(String name, Map<String, Object> context, boolean raiseOnMismatch,
                      MetricsProvider<?> metricsProvider, BiFunction<T, T, Boolean> comparator,
                      ExecutorService executorService); }
Experiment { public T run(Callable<T> control, Callable<T> candidate) throws Exception { if (isAsync()) { return runAsync(control, candidate); } else { return runSync(control, candidate); } } Experiment(MetricsProvider<?> metricsProvider);  Experiment(String name, MetricsProvider<?> metricsProvider);  Experiment(String name, Map<String, Object> context, MetricsProvider<?> metricsProvider);  Experiment(String name, boolean raiseOnMismatch, MetricsProvider<?> metricsProvider);  Experiment(String name, Map<String, Object> context, boolean raiseOnMismatch, MetricsProvider<?> metricsProvider);  Experiment(String name, Map<String, Object> context, boolean raiseOnMismatch,
                      MetricsProvider<?> metricsProvider, BiFunction<T, T, Boolean> comparator);  Experiment(String name, Map<String, Object> context, boolean raiseOnMismatch,
                      MetricsProvider<?> metricsProvider, BiFunction<T, T, Boolean> comparator,
                      ExecutorService executorService); MetricsProvider<?> getMetricsProvider(); boolean getRaiseOnMismatch(); String getName(); T run(Callable<T> control, Callable<T> candidate); T runAsync(Callable<T> control, Callable<T> candidate); Observation<T> executeResult(String name, MetricsProvider.Timer timer, Callable<T> control, boolean shouldThrow); boolean compare(Observation<T> controlVal, Observation<T> candidateVal); }
Experiment { public T run(Callable<T> control, Callable<T> candidate) throws Exception { if (isAsync()) { return runAsync(control, candidate); } else { return runSync(control, candidate); } } Experiment(MetricsProvider<?> metricsProvider);  Experiment(String name, MetricsProvider<?> metricsProvider);  Experiment(String name, Map<String, Object> context, MetricsProvider<?> metricsProvider);  Experiment(String name, boolean raiseOnMismatch, MetricsProvider<?> metricsProvider);  Experiment(String name, Map<String, Object> context, boolean raiseOnMismatch, MetricsProvider<?> metricsProvider);  Experiment(String name, Map<String, Object> context, boolean raiseOnMismatch,
                      MetricsProvider<?> metricsProvider, BiFunction<T, T, Boolean> comparator);  Experiment(String name, Map<String, Object> context, boolean raiseOnMismatch,
                      MetricsProvider<?> metricsProvider, BiFunction<T, T, Boolean> comparator,
                      ExecutorService executorService); MetricsProvider<?> getMetricsProvider(); boolean getRaiseOnMismatch(); String getName(); T run(Callable<T> control, Callable<T> candidate); T runAsync(Callable<T> control, Callable<T> candidate); Observation<T> executeResult(String name, MetricsProvider.Timer timer, Callable<T> control, boolean shouldThrow); boolean compare(Observation<T> controlVal, Observation<T> candidateVal);  }