### Question:
EnterpriseDAO extends DefaultDAOBase<Integer, Enterprise> { public boolean existsAnyOtherWithName(final Enterprise enterprise, final String name) { assert enterprise != null; assert isManaged(enterprise); assert !StringUtils.isEmpty(name); return existsAnyOtherByCriterions(enterprise, nameEqual(name)); } EnterpriseDAO();  EnterpriseDAO(final EntityManager entityManager); @Override List<Enterprise> findAll(); List<Enterprise> findAll(Integer firstElem, final Integer numResults); List<Enterprise> findByNameAnywhere(final String name); List<Enterprise> findByPricingTemplate(Integer firstElem, final PricingTemplate pt,
        final boolean included, final String filterName, final Integer numResults,
        final Integer idEnterprise); @Override void persist(final Enterprise enterprise); boolean existsAnyWithName(final String name); boolean existsAnyOtherWithName(final Enterprise enterprise, final String name); DefaultEntityCurrentUsed getEnterpriseResourceUsage(final int enterpriseId); boolean existAnyEnterpriseWithPricingTemplate(final PricingTemplate pricingTemplate);  }### Answer:
@Test public void existsAnyOtherWithName() { Enterprise enterprise1 = eg().createInstance("abcd"); Enterprise enterprise2 = eg().createInstance("mnbc"); ds().persistAll(enterprise1, enterprise2); EnterpriseDAO dao = createDaoForRollbackTransaction(); Enterprise enterprise1b = reload(dao, enterprise1); assertFalse(dao.existsAnyOtherWithName(enterprise1b, "abcd")); assertFalse(dao.existsAnyOtherWithName(enterprise1b, "inexistent")); assertTrue(dao.existsAnyOtherWithName(enterprise1b, "mnbc")); }