### Question:
HibernateProviderDAO implements ProviderDAO { @Override public Collection<Provider> getProvidersByPerson(Person person, boolean includeRetired) { Criteria criteria = getSession().createCriteria(Provider.class); if (!includeRetired) { criteria.add(Restrictions.eq("retired", false)); } else { criteria.addOrder(Order.asc("retired")); } criteria.add(Restrictions.eq("person", person)); criteria.addOrder(Order.asc("providerId")); return criteria.list(); }  void setSessionFactory(SessionFactory sessionFactory); @Override List<Provider> getAllProviders(boolean includeRetired); @Override Provider saveProvider(Provider provider); @Override void deleteProvider(Provider provider); @Override Provider getProvider(Integer id); @Override Provider getProviderByUuid(String uuid); @Override Collection<Provider> getProvidersByPerson(Person person, boolean includeRetired); @Override ProviderAttribute getProviderAttribute(Integer providerAttributeID); @Override ProviderAttribute getProviderAttributeByUuid(String uuid); @Override List<Provider> getProviders(String name, Map<ProviderAttributeType, String> serializedAttributeValues,
	        Integer start, Integer length, boolean includeRetired); @Override Long getCountOfProviders(String name, boolean includeRetired); @Override List<ProviderAttributeType> getAllProviderAttributeTypes(boolean includeRetired); @Override ProviderAttributeType getProviderAttributeType(Integer providerAttributeTypeId); @Override ProviderAttributeType getProviderAttributeTypeByUuid(String uuid); @Override ProviderAttributeType saveProviderAttributeType(ProviderAttributeType providerAttributeType); @Override void deleteProviderAttributeType(ProviderAttributeType providerAttributeType); @Override boolean isProviderIdentifierUnique(Provider provider); @Override Provider getProviderByIdentifier(String identifier);  }### Answer:
@Test public void getProvidersByPerson_shouldNotReturnRetiredProvidersIfIncludeRetiredFalse() { Collection<Provider> providers = service.getProvidersByPerson(personDao.getPerson(2), false); Assert.assertEquals(1, providers.size()); Assert.assertFalse(providers.iterator().next().getRetired()); }
@Test public void getProvidersByPerson_shouldListRetiredProvidersAtTheEnd() { List<Provider> providers = new ArrayList<>(); providers = (List<Provider>) service.getProvidersByPerson(personDao.getPerson(2), true); Assert.assertEquals(true, providers.get(1).getRetired()); }
@Test public void getProvidersByPerson_shouldReturnAllProvidersIfIncludeRetiredTrue() { Assert.assertEquals(2, service.getProvidersByPerson(personDao.getPerson(2), true).size()); }