@Test
public void testReleaseAndTryRemoveAll() throws Exception {

	// Setup
	LongStateStorage stateHandleProvider = new LongStateStorage();
	ZooKeeperStateHandleStore<Long> store = new ZooKeeperStateHandleStore<>(
			ZOOKEEPER.getClient(), stateHandleProvider, Executors.directExecutor());
	// Config
	final String pathInZooKeeper = "/testDiscardAll";
	final Set<Long> expected = new HashSet<>();
	expected.add(311222268470898L);
	expected.add(132812888L);
	expected.add(27255442L);
	expected.add(11122233124L);
	// Test
	for (long val : expected) {
		store.addAndLock(pathInZooKeeper + val, val);
	}
	store.releaseAndTryRemoveAll();
	// Verify all discarded
	assertEquals(0, ZOOKEEPER.getClient().getChildren().forPath("/").size());
}