RevisionVector implements Iterable<Revision>, Comparable<RevisionVector>, CacheValue { public RevisionVector asBranchRevision(int clusterId) { boolean found = false; Revision[] revs = new Revision[revisions.length]; for (int i = 0; i < revisions.length; i++) { Revision r = revisions[i]; if (r.getClusterId() == clusterId) { r = r.asBranchRevision(); found = true; } revs[i] = r; } if (!found) { throw new IllegalArgumentException("RevisionVector [" + asString() + "] does not have a revision for clusterId " + clusterId); } return new RevisionVector(revs, false, false); } 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(expected = IllegalArgumentException.class) public void asBranchRevision1() { new RevisionVector().asBranchRevision(1); }
@Test(expected = IllegalArgumentException.class) public void asBranchRevision2() { new RevisionVector(new Revision(1, 0, 1)).asBranchRevision(2); }