docs: @SuppressWarnings("unchecked")
    @Nullable
    static List<?> getList(Map<String, ?> obj, String key) {
      assert key != null;
      if (!obj.containsKey(key)) {
        return null;
      }
      Object value = obj.get(key);
      if (!(value instanceof List)) {
        throw new ClassCastException(
            String.format("value '%s' for key '%s' in '%s' is not List", value, key, obj));
      }
      return (List<?>) value;
    }