@Test
  public void testTransactionalLockInstantiation() {
    TransactionalLocks locks = m_injector.getInstance(TransactionalLocks.class);
    List<ReadWriteLock> lockList = new ArrayList<>();
    Set<LockArea> lockAreas = EnumSet.allOf(LockArea.class);
    for (LockArea lockArea : lockAreas) {
      ReadWriteLock lock = locks.getLock(lockArea);
      Assert.assertNotNull(lock);
      lockList.add(lock);
    }

    for (LockArea lockArea : lockAreas) {
      Assert.assertTrue(lockList.contains(locks.getLock(lockArea)));
    }
  }
Tests that for each {@link LockArea}, there's a single {@link Lock}.
ambari-server/src/test/java/org/apache/ambari/annotations/LockAreaTest.java