Record { protected Set<K> describe() { read.lock(); try { return Collections .unmodifiableSet(present.keySet()); } finally { read.unlock(); } } 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 testDescribe() { L locator = getLocator(); Set<K> keys = Sets.newHashSet(); record = getRecord(locator); for (int i = 0; i < TestData.getScaleCount(); i++) { K key = getKey(); keys.add(key); populateRecord(record, locator, key); } Assert.assertEquals(keys, record.describe()); }
@Test public void testDescribeWithTime() { L locator = getLocator(); Set<K> keys = Sets.newHashSet(); record = getRecord(locator); for (int i = 0; i < TestData.getScaleCount(); i++) { K key = getKey(); keys.add(key); populateRecord(record, locator, key); } long timestamp = Time.now(); for (int i = 0; i < TestData.getScaleCount(); i++) { K key = getKey(); populateRecord(record, locator, key); } Assert.assertEquals(keys, record.describe(timestamp)); }