@Test public void testMappings() { EmailList emails = createEmailList(); List<ElectronicMail> result = converter.convert(emails); Assert.assertEquals("Should map 5 emails", 5, result.size()); for (int i = 0; i < 5; i++) { Assert.assertNotNull(result.get(i)); Assert.assertEquals(result.get(i).getEmailAddress(), "email" + i); Assert.assertEquals(result.get(i).getEmailAddressType(), null); } }
public List<ElectronicMail> convert(EmailList list) { if (list == null) { return null; } List<ElectronicMail> result = new ArrayList<ElectronicMail>(); for (Email sifEmail : list) { ElectronicMail sliEmail = new ElectronicMail(); sliEmail.setEmailAddress(sifEmail.getValue()); result.add(sliEmail); } return result; }
EmailListConverter { public List<ElectronicMail> convert(EmailList list) { if (list == null) { return null; } List<ElectronicMail> result = new ArrayList<ElectronicMail>(); for (Email sifEmail : list) { ElectronicMail sliEmail = new ElectronicMail(); sliEmail.setEmailAddress(sifEmail.getValue()); result.add(sliEmail); } return result; } }
EmailListConverter { public List<ElectronicMail> convert(EmailList list) { if (list == null) { return null; } List<ElectronicMail> result = new ArrayList<ElectronicMail>(); for (Email sifEmail : list) { ElectronicMail sliEmail = new ElectronicMail(); sliEmail.setEmailAddress(sifEmail.getValue()); result.add(sliEmail); } return result; }  }
EmailListConverter { public List<ElectronicMail> convert(EmailList list) { if (list == null) { return null; } List<ElectronicMail> result = new ArrayList<ElectronicMail>(); for (Email sifEmail : list) { ElectronicMail sliEmail = new ElectronicMail(); sliEmail.setEmailAddress(sifEmail.getValue()); result.add(sliEmail); } return result; }  List<ElectronicMail> convert(EmailList list); }
EmailListConverter { public List<ElectronicMail> convert(EmailList list) { if (list == null) { return null; } List<ElectronicMail> result = new ArrayList<ElectronicMail>(); for (Email sifEmail : list) { ElectronicMail sliEmail = new ElectronicMail(); sliEmail.setEmailAddress(sifEmail.getValue()); result.add(sliEmail); } return result; }  List<ElectronicMail> convert(EmailList list);  }