PollingAwesomeExecutor extends AbstractAwesomeExecutor { @Override public void execute() { while (!shutdown){ produce(); try { TimeUnit.MILLISECONDS.sleep(pollTimeIntervalMills); } catch (InterruptedException e) { e.printStackTrace(); } consume(); } } PollingAwesomeExecutor(AwesomeURL url); @Override void execute(); void shutdown();  }
@Test public void testExec(){ Map<String,String> param = new HashMap<>(); AwesomeURL url = new AwesomeURL("redis",null,null,"13.114.39.142",6379,null,param); PollingAwesomeExecutor pollingAwesomeExecutor = new PollingAwesomeExecutor(url); pollingAwesomeExecutor.execute(); }