@Override
  public synchronized ScheduledExecutorService getScheduledExecutorService() {
    if (scheduledExecutorService == null) {
      scheduledExecutorService = ExecutorServiceUtil.newScheduledExecutorService();
    }
    return scheduledExecutorService;
  }
@Test
  public void contextThreadpoolIsDaemonized() throws InterruptedException {
    ExecutorService execSvc = context.getScheduledExecutorService();
    final ArrayList<Thread> executingThreads = new ArrayList<Thread>();
    execSvc.execute(new Runnable() {
      @Override
      public void run() {
        synchronized (executingThreads) {
          executingThreads.add(Thread.currentThread());
          executingThreads.notifyAll();
        }
      }
    });
    synchronized (executingThreads) {
      while (executingThreads.isEmpty()) {
        executingThreads.wait();
      }
    }
    assertTrue("executing thread should be a daemon thread.", executingThreads.get(0).isDaemon());
  }