private <T> void addToLockedResources(List<LockedResource> lockedResources,
    Map<T, LockAndQueue> locks, Function<T, String> keyTransformer,
    LockedResourceType resourcesType) {
    locks.entrySet().stream().filter(e -> e.getValue().isLocked())
      .map(e -> createLockedResource(resourcesType, keyTransformer.apply(e.getKey()), e.getValue()))
      .forEachOrdered(lockedResources::add);
  }
@deprecated only used for {@link RecoverMetaProcedure}. Should be removed along with
            {@link RecoverMetaProcedure}.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/SchemaLocking.java