public static void submitScheduledCallableTest(SubmitterSchedulerFactory factory)
      throws InterruptedException, ExecutionException {
    try {
      int runnableCount = 10;
      int scheduleDelay = 50;

      SubmitterSchedulerInterface scheduler = factory.makeSubmitterScheduler(runnableCount, true);

      List<TestCallable> callables = new ArrayList<TestCallable>(runnableCount);
      List<Future<Object>> futures = new ArrayList<Future<Object>>(runnableCount);
      for (int i = 0; i < runnableCount; i++) {
        TestCallable tc = new TestCallable(0);
        Future<Object> future = scheduler.submitScheduled(tc, scheduleDelay);
        assertNotNull(future);
        callables.add(tc);
        futures.add(future);
      }

      // verify execution and execution times
      Iterator<TestCallable> it = callables.iterator();
      Iterator<Future<Object>> futureIt = futures.iterator();
      while (futureIt.hasNext()) {
        Future<Object> future = futureIt.next();
        TestCallable tc = it.next();

        assertTrue(tc.getReturnedResult() == future.get());
        assertTrue(future.isDone());

        long executionDelay = tc.getDelayTillFirstRun();
        assertTrue(executionDelay >= scheduleDelay);
        // should be very timely with a core pool size that matches runnable count
        assertTrue(executionDelay <= (scheduleDelay + 2000));
      }
    } finally {
      factory.shutdown();
    }
  }