@Test
public void testProgressableUtils() throws NoSuchFieldException,
    IllegalAccessException {

  final int sleepTime = 1800;
  final int msecPeriod = 500;
  ExecutorService executor = Executors.newFixedThreadPool(1);
  executor.submit(new Runnable() {
    @Override
    public void run() {
      try {
        Thread.sleep(sleepTime);
      } catch (InterruptedException e) {
        throw new IllegalStateException();
      }
    }
  });
  executor.shutdown();
  CountProgressable countProgressable = new CountProgressable();
  ProgressableUtils.awaitExecutorTermination(executor, countProgressable,
      msecPeriod);
  Assert.assertTrue(countProgressable.counter >= sleepTime / msecPeriod);
  Assert.assertTrue(
      countProgressable.counter <= (sleepTime + msecPeriod) / msecPeriod);
}