static void dedupLockObjects(List<HiveLockObj> lockObjects) {
    Map<String, HiveLockObj> lockMap = new HashMap<String, HiveLockObj>();
    for (HiveLockObj lockObj : lockObjects) {
      String lockName = lockObj.getName();
      HiveLockObj foundLock = lockMap.get(lockName);
      if (foundLock == null || lockObj.getMode() == HiveLockMode.EXCLUSIVE) {
        lockMap.put(lockName, lockObj);
      }
    }
    // copy set of deduped locks back to original list
    lockObjects.clear();
    for (HiveLockObj lockObj : lockMap.values()) {
      lockObjects.add(lockObj);
    }
  }
Dedup the list of lock objects so that there is only one lock per table/partition.
If there is both a shared and exclusive lock for the same object, this will deduped
to just a single exclusive lock.  Package level so that the unit tests
can access it.  Not intended for use outside this class.
@param lockObjects
ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DummyTxnManager.java