@Test
public void apiCollation() throws Exception {

  ApiConfig config2 = configFactory.copy(apiConfig);
  ApiConfig config3 = configFactory.copy(apiConfig);
  ApiConfig config4 = configFactory.copy(apiConfig);
  ApiConfig config5 = configFactory.copy(apiConfig);
  ApiConfig config6 = configFactory.copy(apiConfig);
  config4.setVersion("v2");
  config5.setVersion("v2");
  config6.setName("differentApi");
  Map<ApiKey, String> jsonConfigs = writer.writeConfig(
      ImmutableList.of(apiConfig, config2, config3, config4, config5, config6));
  assertEquals(3, jsonConfigs.size());
  assertThat(jsonConfigs.keySet())
      .containsExactly(new ApiKey("myapi", "v1", "https://myapp.appspot.com/_ah/api"),
          new ApiKey("myapi", "v2", "https://myapp.appspot.com/_ah/api"),
          new ApiKey("differentApi", "v1", "https://myapp.appspot.com/_ah/api"));
}