@Test
public void testRepeatedParameterName() throws Exception {

  @Api
  class Test {
    @ApiMethod(path = "path")
    public void foo(@Named("id") String id1, @Named("id") Long id2) {}
  }
  try {
    g.generateConfig(Test.class).get("myapi-v1.api");
    fail("Config generation for endpoint with two parameters named the same should have failed.");
  } catch (DuplicateParameterNameException expected) {
    // expected
  }
}