@Test
public void shouldWatchOnLock() throws Exception {

    // given
    final LockFactory delegate = mock(LockFactory.class);
    final DistributedLock mock = mock(DistributedLock.class);
    when(mock.getKey()).thenReturn("1234");
    when(delegate.getLock(eq("1234"))).thenReturn(mock);
    final DistributedLockWatcher watcher = new DistributedLockWatcher(delegate);
    // when
    final DistributedLock lock = watcher.getLock("1234");
    // then
    assertEquals(DistributedLockWatcher.WatchedDistributedLock.class, lock.getClass());
}