### Question:
VirtualImageConversionDAO extends DefaultDAOBase<Integer, VirtualImageConversion> { public boolean isConverted(final VirtualMachineTemplate image, final DiskFormatType targetType) { final Criterion compat = Restrictions.and(sameImage(image), targetFormatIn(targetType)); return !createCriteria(compat).list().isEmpty(); } VirtualImageConversionDAO();  VirtualImageConversionDAO(final EntityManager entityManager); @SuppressWarnings("unchecked") List<VirtualImageConversion> compatilbeConversions(
        final VirtualMachineTemplate virtualImage, final HypervisorType hypervisorType); boolean isVirtualImageConverted(final Integer vImageId, final DiskFormatType format); @Deprecated // use selectConversion TODO delthis @SuppressWarnings("unchecked") VirtualImageConversion getUnbundledConversion(final VirtualMachineTemplate image,
        final DiskFormatType format); boolean isConverted(final VirtualMachineTemplate image, final DiskFormatType targetType); Collection<VirtualImageConversion> findByVirtualImage(
        final VirtualMachineTemplate virtualImage); Collection<VirtualImageConversion> findByVirtualImageConversionByNodeVirtualImage(
        final NodeVirtualImage nodeVirtualImage); String getDatacenterUUIDByVirtualImageConversionID(final Integer idVirtualImageConversion); boolean existDuplicatedConversion(final VirtualImageConversion conversion);  }### Answer:
@Test public void testIsConverted() { VirtualImageConversion imageConversion = eg().createUniqueInstance(); List<Object> entitiesToPersist = new ArrayList<Object>(); eg().addAuxiliaryEntitiesToPersist(imageConversion, entitiesToPersist); persistAll(ds(), entitiesToPersist, imageConversion); VirtualImageConversionDAO dao = createDaoForRollbackTransaction(); assertTrue(dao.isConverted(imageConversion.getVirtualMachineTemplate(), imageConversion.getTargetType())); }
@Test public void testIsNotConverted() { VirtualImageConversion imageConversion = eg().createUniqueInstance(); List<Object> entitiesToPersist = new ArrayList<Object>(); eg().addAuxiliaryEntitiesToPersist(imageConversion, entitiesToPersist); persistAll(ds(), entitiesToPersist); VirtualImageConversionDAO dao = createDaoForRollbackTransaction(); assertFalse(dao.isConverted(imageConversion.getVirtualMachineTemplate(), imageConversion.getTargetType())); }