@Test public void testAggregateNullDocumentation() { IllegalArgumentException e = assertThrows(IllegalArgumentException.class, () -> { aggregator.aggregate(Collections.<Structure> emptyList(), null); }); assertThat(e.getMessage()).isEqualTo("Record structure documentation cannot be null."); }
public List<RecordStructure> aggregate(final List<Structure> structures, final Map<String, RecordStructureDocumentation> recordStructureDocumentation) { if (structures == null) { throw new IllegalArgumentException("Structures cannot be null."); } if (recordStructureDocumentation == null) { throw new IllegalArgumentException("Record structure documentation cannot be null."); } final List<RecordStructure> records = new ArrayList<RecordStructure>(structures.size()); for (final Structure structure : structures) { final String structureName = structure.getName(); if (recordStructureDocumentation.containsKey(structureName)) { final RecordStructureDocumentation documentation = recordStructureDocumentation.get(structureName); records.add(new RecordStructure(structureName, toRecordMembers(structure, documentation.getFields()), documentation.getDescription(), documentation.getStructureType())); } else { records.add(new RecordStructure(structureName, toRecordMembers(structure, Collections.<Field> emptyList()))); } } return records; }
RecordStructureAggregator { public List<RecordStructure> aggregate(final List<Structure> structures, final Map<String, RecordStructureDocumentation> recordStructureDocumentation) { if (structures == null) { throw new IllegalArgumentException("Structures cannot be null."); } if (recordStructureDocumentation == null) { throw new IllegalArgumentException("Record structure documentation cannot be null."); } final List<RecordStructure> records = new ArrayList<RecordStructure>(structures.size()); for (final Structure structure : structures) { final String structureName = structure.getName(); if (recordStructureDocumentation.containsKey(structureName)) { final RecordStructureDocumentation documentation = recordStructureDocumentation.get(structureName); records.add(new RecordStructure(structureName, toRecordMembers(structure, documentation.getFields()), documentation.getDescription(), documentation.getStructureType())); } else { records.add(new RecordStructure(structureName, toRecordMembers(structure, Collections.<Field> emptyList()))); } } return records; } }
RecordStructureAggregator { public List<RecordStructure> aggregate(final List<Structure> structures, final Map<String, RecordStructureDocumentation> recordStructureDocumentation) { if (structures == null) { throw new IllegalArgumentException("Structures cannot be null."); } if (recordStructureDocumentation == null) { throw new IllegalArgumentException("Record structure documentation cannot be null."); } final List<RecordStructure> records = new ArrayList<RecordStructure>(structures.size()); for (final Structure structure : structures) { final String structureName = structure.getName(); if (recordStructureDocumentation.containsKey(structureName)) { final RecordStructureDocumentation documentation = recordStructureDocumentation.get(structureName); records.add(new RecordStructure(structureName, toRecordMembers(structure, documentation.getFields()), documentation.getDescription(), documentation.getStructureType())); } else { records.add(new RecordStructure(structureName, toRecordMembers(structure, Collections.<Field> emptyList()))); } } return records; }  }
RecordStructureAggregator { public List<RecordStructure> aggregate(final List<Structure> structures, final Map<String, RecordStructureDocumentation> recordStructureDocumentation) { if (structures == null) { throw new IllegalArgumentException("Structures cannot be null."); } if (recordStructureDocumentation == null) { throw new IllegalArgumentException("Record structure documentation cannot be null."); } final List<RecordStructure> records = new ArrayList<RecordStructure>(structures.size()); for (final Structure structure : structures) { final String structureName = structure.getName(); if (recordStructureDocumentation.containsKey(structureName)) { final RecordStructureDocumentation documentation = recordStructureDocumentation.get(structureName); records.add(new RecordStructure(structureName, toRecordMembers(structure, documentation.getFields()), documentation.getDescription(), documentation.getStructureType())); } else { records.add(new RecordStructure(structureName, toRecordMembers(structure, Collections.<Field> emptyList()))); } } return records; }  List<RecordStructure> aggregate(final List<Structure> structures,
            final Map<String, RecordStructureDocumentation> recordStructureDocumentation); }
RecordStructureAggregator { public List<RecordStructure> aggregate(final List<Structure> structures, final Map<String, RecordStructureDocumentation> recordStructureDocumentation) { if (structures == null) { throw new IllegalArgumentException("Structures cannot be null."); } if (recordStructureDocumentation == null) { throw new IllegalArgumentException("Record structure documentation cannot be null."); } final List<RecordStructure> records = new ArrayList<RecordStructure>(structures.size()); for (final Structure structure : structures) { final String structureName = structure.getName(); if (recordStructureDocumentation.containsKey(structureName)) { final RecordStructureDocumentation documentation = recordStructureDocumentation.get(structureName); records.add(new RecordStructure(structureName, toRecordMembers(structure, documentation.getFields()), documentation.getDescription(), documentation.getStructureType())); } else { records.add(new RecordStructure(structureName, toRecordMembers(structure, Collections.<Field> emptyList()))); } } return records; }  List<RecordStructure> aggregate(final List<Structure> structures,
            final Map<String, RecordStructureDocumentation> recordStructureDocumentation);  }