Record { public int cardinality() { return history.size(); } protected  Record(L locator, @Nullable K key); void append(Revision<L, K, V> revision); int cardinality(); @Override boolean equals(Object obj); long getVersion(); @Override int hashCode(); boolean isEmpty(); boolean isPartial(); @Override String toString();  }
@Test public void testCardinality() { L locator = getLocator(); Record<L, K, V> record = getRecord(locator); Set<K> keys = Sets.newHashSet(); for (int i = 0; i < TestData.getScaleCount(); ++i) { K key = getKey(); V value = getValue(); Revision<L, K, V> revision = getRevision(locator, key, value); record.append(revision); keys.add(key); } Assert.assertEquals(keys.size(), record.cardinality()); }