### Question:
NodeVirtualImageDAO extends DefaultDAOBase<Integer, NodeVirtualImage> { public List<NodeVirtualImage> findByVirtualAppliance(final VirtualAppliance virtualAppliance) { Criteria criteria = sameVirtualAppliance(virtualAppliance); return getResultList(criteria); } NodeVirtualImageDAO();  NodeVirtualImageDAO(final EntityManager entityManager); VirtualAppliance findVirtualAppliance(final VirtualMachine vmachine); NodeVirtualImage findByVirtualMachine(final VirtualMachine vmachine); List<NodeVirtualImage> findByEnterprise(final Enterprise enterprise); List<NodeVirtualImage> findByVirtualImage(final VirtualMachineTemplate virtualImage); List<NodeVirtualImage> findByVirtualAppliance(final VirtualAppliance virtualAppliance); List<Integer> findVirtualMachineIdsByVirtualAppliance(
        final VirtualAppliance virtualAppliance);  }### Answer:
@Test public void testFindByVirtualAppliance() { NodeVirtualImage nodeVirtualImage = eg().createInstance(vapp, vmachine, vimage); ds().persistAll(nodeVirtualImage); NodeVirtualImageDAO nodeVirtualImageDAO = createDaoForRollbackTransaction(); List<NodeVirtualImage> result = nodeVirtualImageDAO.findByVirtualAppliance(vapp); assertFalse(result.isEmpty(), "The list is emtpy!"); }