public void testEqualityComparisonLiteralConversion() {
EntityManager em = getOrCreateEntityManager();
em.getTransaction().begin();
CriteriaBuilderImpl cb = (CriteriaBuilderImpl) em.getCriteriaBuilder();
MetamodelImpl mm = (MetamodelImpl) em.getMetamodel();
CriteriaQuery<Integer> cquery = cb.createQuery( Integer.class );
Root<Product> product = cquery.from( Product.class );
EntityType<Product> Product_ = mm.entity( Product.class );
cquery.select(
cb.toInteger(
product.get(
Product_.getSingularAttribute("quantity", Integer.class))