MemoryProductStore extends AbstractPositionedEntityMemoryStore<Product, DefaultPositionedEntity<Product>> implements ProductStore { public List<Product> findAllWithTitleLike(String title, Integer number, Integer offset) { if (number == 0) { return FluentIterable.from(all()).filter(withTitleLike(title)).skip(offset).toList(); } return FluentIterable.from(all()).filter(withTitleLike(title)).skip(offset).limit(number) .toList(); }  void moveProduct(String productToMove, String productToMoveRelativeTo,
            RelativePosition relativePosition); void updatePosition(Integer position, Product product); List<Product> findOrphanProducts(); Integer countAllForCollection(Collection collection); List<Product> findForCollection(Collection collection, Integer number, Integer offset); @Override List<Product> findOnShelfForCollection(final Collection collection, Integer number, Integer offset); List<Product> findAllForCollection(final Collection collection); List<Product> findAllOnShelf(Integer number, Integer offset); Integer countAllOnShelf(); List<Product> findAllNotVariants(Integer number, Integer offset); Integer countAllNotVariants(); List<Product> findAllWithTitleLike(String title, Integer number, Integer offset); Integer countAllWithTitleLike(String title); void updateStock(UUID productId, Integer stockOffset); List<Feature> findFeatures(Product product); List<Feature> findFeatures(Product product, String feature); Feature findFeature(Product product, String feature, String featureSlug); List<Product> findVariants(Product product); Product findVariant(Product product, String variantSlug); Feature createFeature(Feature feature); List<Product> findAllForCollection(EntityAndParent<Collection> collection);  }
@Test public void testFindWithTitleLike() throws InvalidEntityException, EntityAlreadyExistsException { Product product = new Product(); product.setTitle("Un bel été!"); Product product2 = new Product(); product2.setTitle("Un bel automne!"); productStore.create(product); List<Product> found = productStore.findAllWithTitleLike("été", 0, 0); Assert.assertEquals(1, found.size()); found = productStore.findAllWithTitleLike("hiver", 0, 0); Assert.assertEquals(0, found.size()); }