@Test
public void testLockServiceDoesNotEvictLocksThatAreBeingUsedWithHighConcurrency()
        throws InterruptedException {

    int clients = TestData.getScaleCount();
    final AtomicBoolean done = new AtomicBoolean(false);
    final AtomicBoolean failed = new AtomicBoolean(false);
    Runnable r = new Runnable() {
        @Override
        public void run() {
            while (!done.get()) {
                try {
                    ReadLock readLock = lockService.getReadLock("bar", 1);
                    readLock.lock();
                    readLock.unlock();
                }
                catch (IllegalMonitorStateException e) {
                    done.set(true);
                    failed.set(true);
                    e.printStackTrace();
                }
            }
        }
    };
    for (int i = 0; i < clients; i++) {
        new Thread(r).start();
    }
    Thread.sleep(TestData.getScaleCount() * 10);
    done.set(true);
    Assert.assertFalse(failed.get());
}