### Question:
RevisionRange { public RevisionRange(int from, int to) { this(new Revision(from), new Revision(to)); } RevisionRange(int from, int to);  RevisionRange(Revision from, Revision to); Revision from(); Revision to(); RevisionRange toAscending(); RevisionRange toDescending(); boolean isAscending(); boolean isRelative(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString();  }### Answer:
@Test void revisionRange() { RevisionRange range = new RevisionRange(2, 4); assertThat(range.isAscending()).isTrue(); assertThat(range.isRelative()).isFalse(); assertThat(range.toAscending()).isSameAs(range); assertThat(range.toDescending()).isEqualTo(new RevisionRange(4, 2)); final Revision revisionTen = new Revision(10); range = new RevisionRange(revisionTen, INIT); assertThat(range.isAscending()).isFalse(); assertThat(range.isRelative()).isFalse(); assertThat(range.toAscending()).isEqualTo(new RevisionRange(INIT, revisionTen)); assertThat(range.toDescending()).isSameAs(range); range = new RevisionRange(revisionTen, revisionTen); assertThat(range.isAscending()).isFalse(); assertThat(range.isRelative()).isFalse(); assertThat(range.toAscending()).isSameAs(range); assertThat(range.toDescending()).isSameAs(range); final Revision revisionNegativeThree = new Revision(-3); final Revision revisionNegativeTen = new Revision(-10); range = new RevisionRange(revisionNegativeTen, revisionNegativeThree); assertThat(range.isAscending()).isTrue(); assertThat(range.isRelative()).isTrue(); assertThat(range.toAscending()).isSameAs(range); assertThat(range.toDescending()).isEqualTo( new RevisionRange(revisionNegativeThree, revisionNegativeTen)); final RevisionRange relativeRange = new RevisionRange(INIT, HEAD); assertThat(relativeRange.isRelative()).isTrue(); assertThat(relativeRange.from()).isSameAs(INIT); assertThat(relativeRange.to()).isSameAs(HEAD); assertThatThrownBy(relativeRange::isAscending) .isExactlyInstanceOf(IllegalStateException.class); assertThatThrownBy(relativeRange::toAscending) .isExactlyInstanceOf(IllegalStateException.class); assertThatThrownBy(relativeRange::toDescending) .isExactlyInstanceOf(IllegalStateException.class); }