LogCommand extends RevisionRangeCommand { public long calculateFromRevision(long headRevision) { final long fromRevision; final Revision nextRevision = calculateNextRevision(); if (nextRevision.isHeadRevision()) { fromRevision = headRevision; } else { fromRevision = nextRevision.getNumber(); } return fromRevision; }  String getNextPath(); void setNextPath(final String nextPath); Revision getNextRevision(); void setNextRevision(final Revision nextRevision); boolean isStopOnCopy(); void setStopOnCopy(final boolean stopOnCopy); boolean isPaging(); void setPaging(final boolean paging); long calculateFromRevision(long headRevision); Revision calculateNextRevision(); String calculateNextPath(); @Override boolean equals(final Object obj); @Override int hashCode(); @Override String toString();  }
@Test public void testCalculateFromRevision() throws Exception { final LogCommand command = new LogCommand(); command.setNextRevision(Revision.HEAD); assertEquals(2, command.calculateFromRevision(2)); command.setNextRevision(Revision.create(1)); assertEquals(1, command.calculateFromRevision(2)); }