ProductCartDao extends HibernateDao<ProductCart, String> { public void deleteCartOfUser(User user) { List<ProductCart> carts = getCartsOfUser (user); if (carts!=null) { for (ProductCart cart: carts) delete(cart); } }  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 deleteCartOfUser () { User u = new User (); u.setUUID ("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2"); dao.deleteCartOfUser (u); List<ProductCart> res = dao.getCartsOfUser (u); assertTrue (res.isEmpty ()); }