CountAggregation implements CommonIndexAggregation<Persistable, Long> { public CountAggregation() {} CountAggregation(); boolean isSet(); @Override String toString(); @Override void aggregate(final CommonIndexedPersistenceEncoding entry); @Override Persistable getParameters(); @Override Long getResult(); @Override void setParameters(final Persistable parameters); @Override void clearResult(); @Override byte[] toBinary(); @Override void fromBinary(final byte[] bytes); @Override Long merge(final Long result1, final Long result2); @Override byte[] resultToBinary(final Long result); @Override Long resultFromBinary(final byte[] binary);  }
@Test public void testCountAggregation() { final Long expectedCount = 42L; final List<CommonIndexedPersistenceEncoding> encodings = generateObjects(expectedCount.intValue()); final Long result = aggregateObjects(new CountAggregation(), encodings); assertEquals(expectedCount, result); }