static Map<String, Integer> toIntegerMap(Object objMap) {
    Map<?, ?> map = (Map<?, ?>) objMap;
    Map<String, Integer> result = new HashMap<>();
    for (Object key : map.keySet()) {
      Object value = map.get(key);
      result.put(key.toString(),
          value instanceof Integer ? (Integer) value : Integer.parseInt(value.toString()));
    }
    return result;
  }