RevisionVector implements Iterable<Revision>, Comparable<RevisionVector>, CacheValue { @NotNull public Revision getBranchRevision() { for (Revision r : revisions) { if (r.isBranch()) { return r; } } throw new IllegalStateException( "This vector does not contain a branch revision: " + this); } 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 getBranchRevision() { Revision r1 = new Revision(1, 0, 1); Revision r2 = new Revision(1, 0, 2, true); RevisionVector rv = new RevisionVector(r1, r2); assertEquals(r2, rv.getBranchRevision()); }
@Test(expected = IllegalStateException.class) public void exceptionOnGetBranchRevision() { RevisionVector rv = new RevisionVector(); rv.getBranchRevision(); }