### Question:
DatastoreDAO extends DefaultDAOBase<Integer, Datastore> { public boolean existsAnyWithDirectory(final String directory) { assert !StringUtils.isEmpty(directory); return this.existsAnyByCriterions(equalDirectory(directory)); } DatastoreDAO();  DatastoreDAO(final EntityManager entityManager); List<Datastore> findMachineDatastores(final Machine machine); List<Datastore> findShares(final Datastore datastore); Datastore findDatastore(final String uuid, final Machine machine); boolean existsAnyWithName(final String name); boolean existsAnyOtherWithName(final Datastore entity, final String name); boolean existsAnyWithDirectory(final String directory); boolean existsAnyOtherWithDirectory(final Datastore entity, final String directory);  }### Answer:
@Test public void test_existsAnyWithDirectory() { Assert.assertFalse(createDaoForRollbackTransaction().existsAnyWithDirectory( "INEXISTENT_PROPERTY")); Datastore entity = createUniqueEntity(); entity.setDirectory("A property"); ds().persistAll(entity); Assert.assertTrue(createDaoForRollbackTransaction().existsAnyWithDirectory("A property")); }