@Test public void testOrderOfFieldsInputMultipleOrderedFieldsExpectsInCorrectPositions() { DublinCoreMetadataCollection collection = new DublinCoreMetadataCollection(Arrays .asList(unorderedOne, unorderedTwo, unorderedThree, first, third, seventh)); assertEquals(6, collection.getFields().size()); assertEquals("A field with an order value of 0 should be first in the list of fields", first, collection .getFields().get(0)); assertEquals("A field with an order value of 2 should be in that position in the list of fields", third, collection .getFields().get(2)); assertEquals("A field with an order value of 7 should be in the last position in the list of fields", seventh, collection.getFields().get(5)); collection = new DublinCoreMetadataCollection(Arrays .asList(first, third, seventh, unorderedOne, unorderedTwo, unorderedThree)); assertEquals(6, collection.getFields().size()); assertEquals("A field with an order value of 0 should be first in the list of fields", first, collection .getFields().get(0)); assertEquals("A field with an order value of 2 should be in that position in the list of fields", third, collection .getFields().get(2)); assertEquals("A field with an order value of 7 should be in the last position in the list of fields", seventh, collection.getFields().get(5)); collection = new DublinCoreMetadataCollection(Arrays .asList(third, unorderedOne, unorderedTwo, first, seventh, unorderedThree)); assertEquals(6, collection.getFields().size()); assertEquals("A field with an order value of 0 should be first in the list of fields", first, collection .getFields().get(0)); assertEquals("A field with an order value of 2 should be in that position in the list of fields", third, collection .getFields().get(2)); assertEquals("A field with an order value of 7 should be in the last position in the list of fields", seventh, collection.getFields().get(5)); }
public List<MetadataField> getFields() { return this.fieldsInOrder; }
DublinCoreMetadataCollection { public List<MetadataField> getFields() { return this.fieldsInOrder; } }
DublinCoreMetadataCollection { public List<MetadataField> getFields() { return this.fieldsInOrder; } DublinCoreMetadataCollection();  DublinCoreMetadataCollection(final Iterable<MetadataField> fields);  DublinCoreMetadataCollection(final DublinCoreMetadataCollection c); }
DublinCoreMetadataCollection { public List<MetadataField> getFields() { return this.fieldsInOrder; } DublinCoreMetadataCollection();  DublinCoreMetadataCollection(final Iterable<MetadataField> fields);  DublinCoreMetadataCollection(final DublinCoreMetadataCollection c); DublinCoreMetadataCollection readOnlyCopy(); Map<String, MetadataField> getOutputFields(); void addField(final MetadataField metadata); void addEmptyField(final MetadataField metadataField, final ListProvidersService listProvidersService); void addField(final MetadataField metadataField, final String value, final ListProvidersService listProvidersService); void addField(final MetadataField metadataField, final List<String> values, final ListProvidersService listProvidersService); void removeField(final MetadataField metadata); List<MetadataField> getFields(); void updateStringField(final MetadataField current, final String value); boolean isUpdated(); }
DublinCoreMetadataCollection { public List<MetadataField> getFields() { return this.fieldsInOrder; } DublinCoreMetadataCollection();  DublinCoreMetadataCollection(final Iterable<MetadataField> fields);  DublinCoreMetadataCollection(final DublinCoreMetadataCollection c); DublinCoreMetadataCollection readOnlyCopy(); Map<String, MetadataField> getOutputFields(); void addField(final MetadataField metadata); void addEmptyField(final MetadataField metadataField, final ListProvidersService listProvidersService); void addField(final MetadataField metadataField, final String value, final ListProvidersService listProvidersService); void addField(final MetadataField metadataField, final List<String> values, final ListProvidersService listProvidersService); void removeField(final MetadataField metadata); List<MetadataField> getFields(); void updateStringField(final MetadataField current, final String value); boolean isUpdated();  }