@Override
    public RLock writeLock() {
        return new RedissonWriteLock(commandExecutor, getName());
    }
@Test
    public void testWriteLock() throws InterruptedException {
        final RReadWriteLock lock = redisson.getReadWriteLock("lock");

        final RLock writeLock = lock.writeLock();
        writeLock.lock();

        Assertions.assertTrue(lock.writeLock().tryLock());

        Thread t = new Thread() {
            public void run() {
                 Assertions.assertFalse(writeLock.isHeldByCurrentThread());
                 Assertions.assertTrue(writeLock.isLocked());
                 Assertions.assertFalse(lock.readLock().tryLock());
                 Assertions.assertFalse(redisson.getReadWriteLock("lock").readLock().tryLock());

                 try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

                 Assertions.assertTrue(lock.readLock().tryLock());
                 Assertions.assertTrue(redisson.getReadWriteLock("lock").readLock().tryLock());
            };
        };

        t.start();
        t.join(50);

        writeLock.unlock();
        Assertions.assertTrue(lock.readLock().tryLock());
        Assertions.assertTrue(writeLock.isHeldByCurrentThread());
        writeLock.unlock();
        Thread.sleep(1000);

        Assertions.assertFalse(lock.writeLock().tryLock());
        Assertions.assertFalse(lock.writeLock().isLocked());
        Assertions.assertFalse(lock.writeLock().isHeldByCurrentThread());
        lock.writeLock().forceUnlock();
    }