@Test public void testMap_ModsType_List() { String xml = "<mods xmlns='http: + "<titleInfo/>" + "<identifier type='uuid'>1</identifier>" + "<identifier type='toDelete'>1</identifier>" + "<identifier type='issn'>issn-1</identifier>" + "<recordInfo/>" + "</mods>"; ModsDefinition mods = ModsUtils.unmarshal(xml, ModsDefinition.class); List<IdentifierItem> updates = Arrays.asList( new IdentifierItem(null, "uuid", "insert"), new IdentifierItem(2, "isbn", "isbn-1"), new IdentifierItem(0, "uuid", "2"), new IdentifierItem(null, "uuid", "append") ); IdentifierMapper instance = new IdentifierMapper(); Object[] expResult = { create("uuid", "insert"), create("isbn", "isbn-1"), create("uuid", "2"), create("uuid", "append"), }; instance.map(mods, updates); assertEquals(expResult.length, mods.getIdentifier().size()); assertEquals(1, mods.getTitleInfo().size()); assertIdentifiersEquals(expResult[0], mods.getIdentifier().get(0)); assertIdentifiersEquals(expResult[1], mods.getIdentifier().get(1)); assertIdentifiersEquals(expResult[2], mods.getIdentifier().get(2)); assertIdentifiersEquals(expResult[3], mods.getIdentifier().get(3)); assertEquals(1, mods.getRecordInfo().size()); }
public List<IdentifierItem> map(ModsDefinition mods) { List<IdentifierDefinition> identifiers = mods.getIdentifier(); return mapper.map(identifiers); }
IdentifierMapper { public List<IdentifierItem> map(ModsDefinition mods) { List<IdentifierDefinition> identifiers = mods.getIdentifier(); return mapper.map(identifiers); } }
IdentifierMapper { public List<IdentifierItem> map(ModsDefinition mods) { List<IdentifierDefinition> identifiers = mods.getIdentifier(); return mapper.map(identifiers); }  }
IdentifierMapper { public List<IdentifierItem> map(ModsDefinition mods) { List<IdentifierDefinition> identifiers = mods.getIdentifier(); return mapper.map(identifiers); }  List<IdentifierItem> map(ModsDefinition mods); ModsDefinition map(ModsDefinition mods, List<IdentifierItem> items); }
IdentifierMapper { public List<IdentifierItem> map(ModsDefinition mods) { List<IdentifierDefinition> identifiers = mods.getIdentifier(); return mapper.map(identifiers); }  List<IdentifierItem> map(ModsDefinition mods); ModsDefinition map(ModsDefinition mods, List<IdentifierItem> items);  }