@Test
public void testCount()
{
ObjectStore os = ObjectStore.Factory.create();
ObjectStoreSession oss = os.beginSession();
List<Foo> foos = Lists.newArrayList();
for (int ct = 0; ct < 100; ct++)
foos.add(new Foo(ct));
oss.store(foos).now();
assertEquals(100, oss.find(Foo.class).count().now().intValue());
assertEquals(50, oss.find(Foo.class).filter("value", Op.LessThan, 50).count().now().intValue());
assertEquals(51, oss.find(Foo.class).filter("value", Op.LessThanOrEqualTo, 50).count().now().intValue());
assertEquals(1, oss.find(Foo.class).filter("value", Op.EqualTo, 50).count().now().intValue());
assertEquals(99, oss.find(Foo.class).filter("value", Op.NotEqualTo, 50).count().now().intValue());
assertEquals(24, oss.find(Foo.class).filter("value", Op.GreaterThan, 75).count().now().intValue());
assertEquals(25, oss.find(Foo.class).filter("value", Op.GreaterThanOrEqualTo, 75).count().now().intValue());
}