@Test
public void testPositiveTimeout() throws Exception {

    final LearnerSnapshotThrottler throttler = new LearnerSnapshotThrottler(1, 200);
    ExecutorService threadPool = Executors.newFixedThreadPool(1);
    LearnerSnapshot first = throttler.beginSnapshot(false);
    final CountDownLatch snapshotProgressLatch = new CountDownLatch(1);
    Future<Boolean> result = threadPool.submit(new Callable<Boolean>() {
        @Override
        public Boolean call() {
            try {
                snapshotProgressLatch.countDown();
                LearnerSnapshot second = throttler.beginSnapshot(false);
                second.close();
            }
            catch (Exception e) {
                return false;
            }
            return true;
        }
    });
    snapshotProgressLatch.await();
    first.close();
    Assert.assertTrue(result.get());
}