public static <T> void filterMapKeys(Map<String, T> map, Predicate<String> predicate) {
    if (map == null) {
      return;
    }
    map.entrySet().removeIf(entry -> predicate.test(entry.getKey()));
  }
filters a given map with predicate provided. All entries of map whose key matches with
predicate will be removed. Expects map to be modifiable and does the operation on actual map,
so does not return a copy of filtered map.
@param map A map of String key-value pairs
@param predicate Predicate with pattern to filter the map
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreUtils.java