@Override
  public int compare(LockType t1, LockType t2) {
    return orderOfRestrictiveness.indexOf(t1) - orderOfRestrictiveness.indexOf(t2);
  }
Sort more restrictive locks after less restrictive ones.
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/LockTypeComparator.java