PollScheduler { public void start() { int numThreads = Runtime.getRuntime().availableProcessors(); ThreadFactory factory = ThreadFactories.withName("ServoPollScheduler-%d"); start(Executors.newScheduledThreadPool(numThreads, factory)); } private  PollScheduler(); static PollScheduler getInstance(); void addPoller(PollRunnable task, long delay, TimeUnit timeUnit); void start(); void start(ScheduledExecutorService service); void stop(); boolean isStarted();  }
@Test public void testStart() throws Exception { ScheduledExecutorService s = Executors.newScheduledThreadPool(2); PollScheduler.getInstance().start(s); assertTrue(PollScheduler.getInstance().isStarted()); PollScheduler.getInstance().stop(); }