ScheduledExecutorServiceWithTracing extends ExecutorServiceWithTracing implements ScheduledExecutorService { public static ScheduledExecutorServiceWithTracing withTracing(ScheduledExecutorService delegate) { return new ScheduledExecutorServiceWithTracing(delegate); } ScheduledExecutorServiceWithTracing(ScheduledExecutorService delegate); static ScheduledExecutorServiceWithTracing withTracing(ScheduledExecutorService delegate); @Override ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit); @Override ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit); @Override ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit); @Override ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit);  }
@DataProvider(value = { "true", "false" }) @Test public void constructor_sets_fields_as_expected(boolean useStaticFactoryMethod) { executorServiceMock = mock(ScheduledExecutorService.class); instance = (useStaticFactoryMethod) ? withTracing(executorServiceMock) : new ScheduledExecutorServiceWithTracing(executorServiceMock); assertThat(instance.delegate).isSameAs(executorServiceMock); }