Revision implements Serializable, Comparable<Revision> { @Override public String toString() { return headRevision ? "HEAD" : revisionDate != null ? "{" + DateUtil.formatISO8601(revisionDate) + "}" : Long.toString(revisionNumber); } private  Revision(final long revisionNumber, final Date revisionDate, final boolean headRevision); static Revision create(final long revision); static Revision createHeadRevision(final long revision); static Revision create(final Date revision); static Revision create(final Date revision, final long revisionNumber); static Revision parse(final String text); long getNumber(); Date getDate(); @Override int compareTo(Revision o); boolean isHeadRevision(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final Revision FIRST; static final Revision UNDEFINED; static final Revision HEAD; }
@Test public void namedVersionToString() throws Exception { assertEquals("HEAD", Revision.HEAD.toString()); }