ProductCartDao extends HibernateDao<ProductCart, String> { public List<Long> getProductsIdOfCart (User user) { long start = new Date ().getTime (); List<Long>ret = toId(scrollCartOfUser (user, 0, -1)); long end = new Date ().getTime (); logger.info("Query getProductsIdOfCart spent " + (end-start) + "ms"); return ret; }  static T firstResult(Collection<T> results); ProductCart getCartOfUser(final User user); @SuppressWarnings ("unchecked") List<ProductCart> getCartsOfUser(final User user); void deleteCartOfUser(User user); void deleteProductReferences(final Product product); List<Product> scrollCartOfUser(final User user, final int skip,
         final int top); List<Long> getProductsIdOfCart(User user);  }
@Test public void getProductsIdOfCart () { User user = new User (); user.setUUID ("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0"); List<Long> ids = dao.getProductsIdOfCart (user); assertNotNull (ids); assertEquals (ids.size (), 2); assertTrue (ids.contains (Long.valueOf (0))); assertTrue (ids.contains (Long.valueOf (5))); }