RevisionVector implements Iterable<Revision>, Comparable<RevisionVector>, CacheValue { public RevisionVector remove(int clusterId) { if (revisions.length == 0) { return this; } boolean found = false; for (Revision r : revisions) { if (r.getClusterId() == clusterId) { found = true; break; } else if (r.getClusterId() > clusterId) { break; } } if (!found) { return this; } Revision[] revs = new Revision[revisions.length - 1]; int idx = 0; for (Revision r : revisions) { if (r.getClusterId() != clusterId) { revs[idx++] = r; } } 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 public void remove() { RevisionVector rv = new RevisionVector(); assertSame(rv, rv.remove(1)); Revision rev1 = new Revision(1, 0, 1); Revision rev2 = new Revision(1, 0, 2); Revision rev3 = new Revision(1, 0, 3); rv = new RevisionVector(rev1); assertSame(rv, rv.remove(2)); assertEquals(new RevisionVector(), rv.remove(rev1.getClusterId())); rv = new RevisionVector(rev1, rev2, rev3); assertEquals(new RevisionVector(rev2, rev3), rv.remove(rev1.getClusterId())); assertEquals(new RevisionVector(rev1, rev3), rv.remove(rev2.getClusterId())); assertEquals(new RevisionVector(rev1, rev2), rv.remove(rev3.getClusterId())); }