@Test public void testEmptyList() { EmailList list = new EmailList(); List<ElectronicMail> result = converter.convert(list); Assert.assertEquals(0, result.size()); }
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);  }