  @Test
  public void failsOnNonDuplicateNames() {

    List<MethodDescriptor<?, ?>> descriptors = Arrays.<MethodDescriptor<?, ?>>asList(
        MethodDescriptor.<Void, Void>newBuilder()
          .setType(MethodType.UNARY)
          .setFullMethodName(MethodDescriptor.generateFullMethodName("name", "method"))
          .setRequestMarshaller(TestMethodDescriptors.voidMarshaller())
          .setResponseMarshaller(TestMethodDescriptors.voidMarshaller())
          .build(),
        MethodDescriptor.<Void, Void>newBuilder()
          .setType(MethodType.UNARY)
          .setFullMethodName(MethodDescriptor.generateFullMethodName("name", "method"))
          .setRequestMarshaller(TestMethodDescriptors.voidMarshaller())
          .setResponseMarshaller(TestMethodDescriptors.voidMarshaller())
          .build());

    thrown.expect(IllegalArgumentException.class);
    thrown.expectMessage("duplicate");

    new ServiceDescriptor("name", descriptors);
  }