test_class.declarator: rowSpecMerger = new RowSpecMerger(new FieldSpecMerger())
test_class.original_string: RowSpecMerger rowSpecMerger = new RowSpecMerger(new FieldSpecMerger());
test_class.type: RowSpecMerger
test_class.var_name: rowSpecMerger
test_class.declarator: isNull = FieldSpecFactory.nullOnly()
test_class.original_string: FieldSpec isNull = FieldSpecFactory.nullOnly();
test_class.type: FieldSpec
test_class.var_name: isNull
test_class.declarator: notNull = FieldSpecFactory.fromType(FieldType.STRING).withNotNull()
test_class.original_string: FieldSpec notNull = FieldSpecFactory.fromType(FieldType.STRING).withNotNull();
test_class.type: FieldSpec
test_class.var_name: notNull
test_class.declarator: A = createField("A")
test_class.original_string: Field A = createField("A");
test_class.type: Field
test_class.var_name: A
test_class.declarator: B = createField("B")
test_class.original_string: Field B = createField("B");
test_class.type: Field
test_class.var_name: B
test_class.declarator: fields = new ProfileFields(Arrays.asList(A, B))
test_class.original_string: Fields fields = new ProfileFields(Arrays.asList(A, B));
test_class.type: Fields
test_class.var_name: fields
test_class.file: core/src/test/java/com/scottlogic/datahelix/generator/core/fieldspecs/RowSpecMergerTest.java
test_class.identifier: RowSpecMergerTest
test_case.body: @Test
      void merge_notContradictoryForField() {
          RowSpec left = new RowSpec(fields, ImmutableMap.of(A, isNull), Collections.emptyList());
          RowSpec right = new RowSpec(fields, ImmutableMap.of(A, isNull), Collections.emptyList());
  
          RowSpec merged = rowSpecMerger.merge(left, right).get();
  
          assertEquals(merged.getSpecForField(A), isNull);
      }
test_case.class_method_signature: RowSpecMergerTest.merge_notContradictoryForField()
test_case.full_signature: @Test void merge_notContradictoryForField()
test_case.identifier: merge_notContradictoryForField
test_case.invocations: of emptyList of emptyList get merge assertEquals getSpecForField
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void merge_notContradictoryForField()
focal_class.declarator: fieldSpecMerger
focal_class.modifier: private final
focal_class.original_string: private final FieldSpecMerger fieldSpecMerger;
focal_class.type: FieldSpecMerger
focal_class.var_name: fieldSpecMerger
focal_class.file: core/src/main/java/com/scottlogic/datahelix/generator/core/fieldspecs/RowSpecMerger.java
focal_class.identifier: RowSpecMerger
focal_class.class_method_signature: RowSpecMerger.RowSpecMerger(FieldSpecMerger fieldSpecMerger)
focal_class.full_signature: @Inject public  RowSpecMerger(FieldSpecMerger fieldSpecMerger)
focal_class.identifier: RowSpecMerger
focal_class.modifiers: @Inject public
focal_class.parameters: (FieldSpecMerger fieldSpecMerger)
focal_class.signature:  RowSpecMerger(FieldSpecMerger fieldSpecMerger)
focal_class.class_method_signature: RowSpecMerger.merge(RowSpec left, RowSpec right)
focal_class.full_signature: public Optional<RowSpec> merge(RowSpec left, RowSpec right)
focal_class.identifier: merge
focal_class.modifiers: public
focal_class.parameters: (RowSpec left, RowSpec right)
focal_class.return: Optional<RowSpec>
focal_class.signature: Optional<RowSpec> merge(RowSpec left, RowSpec right)
focal_method.body: public Optional<RowSpec> merge(RowSpec left, RowSpec right) {
          Map<Field, FieldSpec> newMap = new HashMap<>();
  
          for (Field field : left.getFields()) {
              Optional<FieldSpec> merge = fieldSpecMerger.merge(left.getSpecForField(field), right.getSpecForField(field), false);
  
              if (!merge.isPresent()){
                  return Optional.empty();
              }
              newMap.put(field, merge.get());
          }
  
          List<FieldSpecRelation> relations = new ArrayList<>(
              SetUtils.union(left.getRelations(), right.getRelations()));
  
          return Optional.of(new RowSpec(left.getFields(), newMap, relations));
      }
focal_method.class_method_signature: RowSpecMerger.merge(RowSpec left, RowSpec right)
focal_method.full_signature: public Optional<RowSpec> merge(RowSpec left, RowSpec right)
focal_method.identifier: merge
focal_method.invocations: getFields merge getSpecForField getSpecForField isPresent empty put get union getRelations getRelations of getFields
focal_method.modifiers: public
focal_method.parameters: (RowSpec left, RowSpec right)
focal_method.return: Optional<RowSpec>
focal_method.signature: Optional<RowSpec> merge(RowSpec left, RowSpec right)