test_class.file: conjure-core/src/test/java/com/palantir/conjure/defs/validator/ErrorDefinitionValidatorTest.java
test_class.identifier: ErrorDefinitionValidatorTest
test_case.body: @Test
      public void testUniqueArgNamesValidator() {
          FieldDefinition safeArg1 = FieldDefinition.builder()
                  .fieldName(FieldName.of("fooBar"))
                  .type(Type.primitive(PrimitiveType.STRING))
                  .build();
          FieldDefinition unsafeArg1 = FieldDefinition.builder()
                  .fieldName(FieldName.of("foo-bar"))
                  .type(Type.primitive(PrimitiveType.STRING))
                  .build();
          ErrorDefinition definition1 = ErrorDefinition.builder()
                  .errorName(TypeName.of("Foo", "package"))
                  .namespace(ErrorNamespace.of("Test"))
                  .code(ErrorCode.INVALID_ARGUMENT)
                  .safeArgs(safeArg1)
                  .unsafeArgs(unsafeArg1)
                  .build();
  
          assertThatThrownBy(() -> ErrorDefinitionValidator.validate(definition1))
                  .isInstanceOf(IllegalArgumentException.class)
                  .hasMessage("ErrorDefinition must not contain duplicate field names (modulo case normalization): "
                          + "foo-bar vs fooBar");
  
          FieldDefinition safeArg2 = FieldDefinition.builder()
                  .fieldName(FieldName.of("foo-bar"))
                  .type(Type.primitive(PrimitiveType.STRING))
                  .build();
          FieldDefinition unsafeArg2 = FieldDefinition.builder()
                  .fieldName(FieldName.of("foo_bar"))
                  .type(Type.primitive(PrimitiveType.STRING))
                  .build();
          ErrorDefinition definition2 = ErrorDefinition.builder()
                  .errorName(TypeName.of("Foo", "package"))
                  .namespace(ErrorNamespace.of("Test"))
                  .code(ErrorCode.INVALID_ARGUMENT)
                  .safeArgs(safeArg2)
                  .unsafeArgs(unsafeArg2)
                  .build();
  
          assertThatThrownBy(() -> ErrorDefinitionValidator.validate(definition2))
                  .isInstanceOf(IllegalArgumentException.class)
                  .hasMessage("ErrorDefinition must not contain duplicate field names (modulo case normalization): "
                          + "foo-bar vs foo_bar");
      }
test_case.class_method_signature: ErrorDefinitionValidatorTest.testUniqueArgNamesValidator()
test_case.full_signature: @Test public void testUniqueArgNamesValidator()
test_case.identifier: testUniqueArgNamesValidator
test_case.invocations: build type fieldName builder of primitive build type fieldName builder of primitive build unsafeArgs safeArgs code namespace errorName builder of of hasMessage isInstanceOf assertThatThrownBy validate build type fieldName builder of primitive build type fieldName builder of primitive build unsafeArgs safeArgs code namespace errorName builder of of hasMessage isInstanceOf assertThatThrownBy validate
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testUniqueArgNamesValidator()
focal_class.declarator: UNIQUE_FIELD_NAMES_VALIDATOR =
              new UniqueFieldNamesValidator(ErrorDefinition.class)
focal_class.modifier: private static final
focal_class.original_string: private static final UniqueFieldNamesValidator UNIQUE_FIELD_NAMES_VALIDATOR =
              new UniqueFieldNamesValidator(ErrorDefinition.class);
focal_class.type: UniqueFieldNamesValidator
focal_class.var_name: UNIQUE_FIELD_NAMES_VALIDATOR
focal_class.file: conjure-core/src/main/java/com/palantir/conjure/defs/validator/ErrorDefinitionValidator.java
focal_class.identifier: ErrorDefinitionValidator
focal_class.class_method_signature: ErrorDefinitionValidator.ErrorDefinitionValidator()
focal_class.full_signature: private  ErrorDefinitionValidator()
focal_class.identifier: ErrorDefinitionValidator
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  ErrorDefinitionValidator()
focal_class.class_method_signature: ErrorDefinitionValidator.validate(ErrorDefinition definition)
focal_class.full_signature: public static void validate(ErrorDefinition definition)
focal_class.identifier: validate
focal_class.modifiers: public static
focal_class.parameters: (ErrorDefinition definition)
focal_class.return: void
focal_class.signature: void validate(ErrorDefinition definition)
focal_method.body: public static void validate(ErrorDefinition definition) {
          UNIQUE_FIELD_NAMES_VALIDATOR.validate(
                  Stream.concat(definition.getSafeArgs().stream(), definition.getUnsafeArgs().stream())
                          .map(FieldDefinition::getFieldName)
                          .collect(Collectors.toSet()));
      }
focal_method.class_method_signature: ErrorDefinitionValidator.validate(ErrorDefinition definition)
focal_method.full_signature: public static void validate(ErrorDefinition definition)
focal_method.identifier: validate
focal_method.invocations: validate collect map concat stream getSafeArgs stream getUnsafeArgs toSet
focal_method.modifiers: public static
focal_method.parameters: (ErrorDefinition definition)
focal_method.return: void
focal_method.signature: void validate(ErrorDefinition definition)