RevisionVector implements Iterable<Revision>, Comparable<RevisionVector>, CacheValue { public Revision getRevision(int clusterId) { for (Revision r : revisions) { int cmp = Ints.compare(r.getClusterId(), clusterId); if (cmp == 0) { return r; } else if (cmp > 0) { break; } } return null; } private  RevisionVector(@NotNull Revision[] revisions,
                           boolean checkUniqueClusterIds,
                           boolean sort);  RevisionVector(@NotNull Revision... revisions);  RevisionVector(@NotNull Iterable<Revision> revisions);  RevisionVector(@NotNull Set<Revision> revisions); RevisionVector update(@NotNull Revision revision); RevisionVector remove(int clusterId); RevisionVector pmin(@NotNull RevisionVector vector); RevisionVector pmax(@NotNull RevisionVector vector); RevisionVector difference(RevisionVector vector); boolean isRevisionNewer(@NotNull Revision revision); boolean isBranch(); @NotNull Revision getBranchRevision(); Revision getRevision(int clusterId); String asString(); StringBuilder toStringBuilder(StringBuilder sb); static RevisionVector fromString(String s); RevisionVector asTrunkRevision(); RevisionVector asBranchRevision(int clusterId); int getDimensions(); @Override int getMemory(); @Override int compareTo(@NotNull RevisionVector other); @Override Iterator<Revision> iterator(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void getRevision() { RevisionVector rv = new RevisionVector(); assertNull(rv.getRevision(1)); Revision r11 = new Revision(1, 0, 1); rv = rv.update(r11); assertEquals(r11, rv.getRevision(1)); assertNull(rv.getRevision(2)); Revision r13 = new Revision(1, 0, 3); rv = rv.update(r13); assertEquals(r13, rv.getRevision(3)); assertNull(rv.getRevision(2)); }