@Test
public void testBlockinLock() throws InterruptedException, IOException {

  final LockingManagement memoryLockManager = new MemoryLockManager(UUID.randomUUID().toString());
  final DefaultTransaction t1 = new DefaultTransaction();
  memoryLockManager.lock(t1, "f3");
  final DefaultTransaction t2 = new DefaultTransaction();
  final Thread commiter = new Thread(new Runnable() {
    @Override
    public void run() {
      try {
        Thread.sleep(4000);
        // System.out.println("commit");
        t1.commit();
      } catch (final InterruptedException e) {
        e.printStackTrace();
        throw new RuntimeException(e);
      } catch (final IOException e) {
        e.printStackTrace();
        throw new RuntimeException(e);
      }
    }
  });
  final long currentTime = System.currentTimeMillis();
  commiter.start();
  // will block\
  // System.out.println("t2");
  memoryLockManager.lock(t2, "f3");
  final long endTime = System.currentTimeMillis();
  // System.out.println(endTime + " > " + currentTime);
  assertTrue((endTime - currentTime) >= 3800);
  commiter.join();
  t2.commit();
  t2.close();
  t1.close();
}