@Test
public void ensure_that_two_different_lock_are_returned_when_threshold_is_reached() {

    // given
    ReentrantReadWriteLockGroup locks = new ReentrantReadWriteLockGroup(true, 1);
    // when
    ReentrantReadWriteLock firstLockForOneValue = locks.getLock("1");
    Runnable runnable = new Runnable() {
        @Override
        public void run() {
            firstLockForOneValue.writeLock().lock();
        }
    };
    Thread t = new Thread(runnable);
    t.start();
    try {
        t.join();
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    ReentrantReadWriteLock firstLockForTwoValue = locks.getLock("2");
    ReentrantReadWriteLock secondLockForOneValue = locks.getLock("1");
    // then
    assertEquals(firstLockForOneValue, secondLockForOneValue);
}