@Test
public void testIsWriteLockedByCurrentThread() {

    Runnable a = new Runnable() {
        @Override
        public void run() {
            Assert.assertFalse(lock.isWriteLockedByCurrentThread());
        }
    };
    Runnable b = new Runnable() {
        @Override
        public void run() {
            lock.writeLock().lock();
            Assert.assertTrue(lock.isWriteLockedByCurrentThread());
        }
    };
    for (int i = 0; i < TestData.getScaleCount(); i++) {
        Thread t = i % 3 == 0 ? new Thread(a) : new Thread(b);
        t.start();
    }
}