VectorClock extends TreeMap<String, Long> { public Long getClock(String unit) { return get(unit); }  Long incrementClock(String unit); void setClock(String unit, long value); Long getClock(String unit); @Override Long get(Object unit); @Override VectorClock clone(); @Override String toString(); static VectorClock parseVectorClock(String serializedVectorClock); static VectorClockComparison compare(VectorClock clock1, VectorClock clock2); static final Pattern MACHINE_PATTERN; }
@Test public void testNonExistingVectorClockUsage() { VectorClock vc = new VectorClock(); assertEquals("Expected clock value to be different.", 0L, (long) vc.getClock("NonExistingUnit")); }