BaseEntityMemoryStore implements Store<T, UUID> { public List<T> findAll(Integer number, Integer offset) { if (number == 0) { return FluentIterable.from(entities.values()).skip(offset).toList(); } return FluentIterable.from(entities.values()).skip(offset).limit(number).toList(); }  T create(@Valid T entity); void update(@Valid T entity); void delete(@Valid T entity); Integer countAll(); List<T> findAll(Integer number, Integer offset); List<T> findByIds(final List<UUID> ids); T findById(UUID id);  }
@Test public void testFindAll() throws Exception { List<MyEntity> created = Lists.newArrayList(); for (int i = 0; i < 15; i++) { created.add(store.create(new MyEntity())); } List<MyEntity> all = store.findAll(10, 0); Assert.assertEquals(10, all.size()); for (MyEntity entity : all) { Assert.assertTrue(created.contains(entity)); } }