@Override
    public void lock() {
        try {
            lockInterruptibly(-1, null);
        } catch (InterruptedException e) {
            throw new IllegalStateException();
        }
    }
@Test
    public void testIsLockedOtherThread() throws InterruptedException {
        RLock lock = redisson.getSpinLock("lock");
        lock.lock();

        Thread t = new Thread() {
            public void run() {
                RLock lock = redisson.getSpinLock("lock");
                Assertions.assertTrue(lock.isLocked());
            }

            ;
        };

        t.start();
        t.join();
        lock.unlock();

        Thread t2 = new Thread() {
            public void run() {
                RLock lock = redisson.getSpinLock("lock");
                Assertions.assertFalse(lock.isLocked());
            }

            ;
        };

        t2.start();
        t2.join();
    }