### Question:
DAOProductImpl extends AbstractDAO<ProductEntity, JPAProductEntity> implements DAOProduct { @Override public List<ProductEntity> getAllActiveProducts() { return this.checkEntityList(this.queryProduct().active.eq(true).findList(), ProductEntity.class); }  @Override List<ProductEntity> getAllActiveProducts(); @Override ProductEntity getEntityInstance();  }### Answer:
@Test public void getAllActiveProducts_noProducts() { List<ProductEntity> products = DAOProductImplTest.daoProductImpl.getAllActiveProducts(); Assert.assertEquals(products.size(), 0); }
@Test public void getAllActiveProducts_noActiveProducts() { Ebean.beginTransaction(); JPAProductEntity product = new JPAProductEntity(); product.setUID(DAOProductImplTest.inactiveObjUid); product.setDescription("Test Product 0"); Ebean.commitTransaction(); List<ProductEntity> products = DAOProductImplTest.daoProductImpl.getAllActiveProducts(); Assert.assertEquals(products.size(), 0); }
@Test public void getAllActiveProducts() { Ebean.beginTransaction(); JPAProductEntity product = new JPAProductEntity(); product.setUID(DAOProductImplTest.existingObjUid1); product.setDescription("Test Product 1"); DAOProductImplTest.daoProductImpl.create(product); product = new JPAProductEntity(); product.setUID(DAOProductImplTest.existingObjUid2); product.setDescription("Test Product 2"); DAOProductImplTest.daoProductImpl.create(product); Ebean.commitTransaction(); List<ProductEntity> products = DAOProductImplTest.daoProductImpl.getAllActiveProducts(); Assert.assertEquals(products.size(), 2); }