@SuppressWarnings("JdkObsolete") // javax requires hashtable param for ObjectName constructor
  public static Hashtable<String, String> buldKeyValueTable(String[] keys, String[] values) {
    if (keys.length != values.length) {
      LOG.error("keys and values arrays must be same size");
      return null;
    }
    if (keys.length == 0 || values.length == 0) {
      LOG.error("keys and values arrays can not be empty;");
      return null;
    }
    Hashtable<String, String> table = new Hashtable<>();
    for (int i = 0; i < keys.length; i++) {
      table.put(keys[i], values[i]);
    }
    return table;
  }
Method for building map used for constructing ObjectName. Mapping is done with arrays indices
@param keys   Map keys
@param values Map values
@return Map or null if arrays are empty or have different number of elements
hbase-http/src/main/java/org/apache/hadoop/hbase/util/JSONMetricUtil.java