class MarketDataSpecificationJsonReader {

  public static List<MarketDataSpecification> buildSpecifications(String json) {
    try {
      JSONArray array = new JSONArray(json);
      List<MarketDataSpecification> specs = Lists.newArrayListWithCapacity(array.length());
      for (int i = 0; i < array.length(); i++) {
        specs.add(buildSpecification(array.getJSONObject(i)));
      }
      return specs;
    } catch (JSONException e) {
      throw new IllegalArgumentException("Failed to parse MarketDataSpecification JSON", e);
    }
  }

}