@Test(expected = SnapshotThrottleException.class)
public void testTryWithResourceThrottle() throws Exception {

    LearnerSnapshotThrottler throttler = new LearnerSnapshotThrottler(1);
    LearnerSnapshot outer = throttler.beginSnapshot(true);
    try {
        LearnerSnapshot inner = throttler.beginSnapshot(false);
        try {
            Assert.fail("shouldn't be able to have both snapshots open");
        } finally {
            inner.close();
        }
    } finally {
        outer.close();
    }
}