@Test
void two_bucket_one_metric_should_pass() {

  String response = "{\n"
      + "  \"composite#composite_buckets\": {\n"
      + "    \"after_key\": {\n"
      + "      \"type\": \"sale\",\n"
      + "      \"region\": \"us\"\n"
      + "    },\n"
      + "    \"buckets\": [\n"
      + "      {\n"
      + "        \"key\": {\n"
      + "          \"type\": \"cost\",\n"
      + "          \"region\": \"us\"\n"
      + "        },\n"
      + "        \"avg#avg\": {\n"
      + "          \"value\": 20\n"
      + "        }\n"
      + "      },\n"
      + "      {\n"
      + "        \"key\": {\n"
      + "          \"type\": \"sale\",\n"
      + "          \"region\": \"uk\"\n"
      + "        },\n"
      + "        \"avg#avg\": {\n"
      + "          \"value\": 130\n"
      + "        }\n"
      + "      }\n"
      + "    ]\n"
      + "  }\n"
      + "}";
  assertThat(parse(response),
      containsInAnyOrder(ImmutableMap.of("type", "cost", "region", "us", "avg", 20d),
          ImmutableMap.of("type", "sale", "region", "uk", "avg", 130d)));
}