@Test public void nullFirstReturnedFromNoContacts() throws ComponentLookupException { when(this.provider1.getContacts(this.patient)).thenReturn(null); List<PatientContactProvider> providers = new ArrayList<>(); providers.add(this.provider1); when(this.providersProvider.get()).thenReturn(providers); Assert.assertNull(this.mocker.getComponentUnderTest().getFirst(this.patient)); }
@Override public ContactInfo getFirst(Patient patient) { List<ContactInfo> all = getAll(patient); if (!all.isEmpty()) { return all.get(0); } return null; }
DefaultPatientContactsManager implements PatientContactsManager { @Override public ContactInfo getFirst(Patient patient) { List<ContactInfo> all = getAll(patient); if (!all.isEmpty()) { return all.get(0); } return null; } }
DefaultPatientContactsManager implements PatientContactsManager { @Override public ContactInfo getFirst(Patient patient) { List<ContactInfo> all = getAll(patient); if (!all.isEmpty()) { return all.get(0); } return null; }  }
DefaultPatientContactsManager implements PatientContactsManager { @Override public ContactInfo getFirst(Patient patient) { List<ContactInfo> all = getAll(patient); if (!all.isEmpty()) { return all.get(0); } return null; }  @Override List<ContactInfo> getAll(Patient patient); @Override ContactInfo getFirst(Patient patient); }
DefaultPatientContactsManager implements PatientContactsManager { @Override public ContactInfo getFirst(Patient patient) { List<ContactInfo> all = getAll(patient); if (!all.isEmpty()) { return all.get(0); } return null; }  @Override List<ContactInfo> getAll(Patient patient); @Override ContactInfo getFirst(Patient patient);  }