RangeOption implements Comparable<RangeOption> { public String toString() { StringBuilder rangeBuilder = new StringBuilder(); appendTo(rangeBuilder); return rangeBuilder.toString(); } RangeOption(int initial);  RangeOption(int initial, int terminal); boolean isTerminalEndOfRange(); boolean isTerminalMissing(); int getInitial(); int getTerminal(); boolean isFullRange(); String toString(); void appendTo(StringBuilder rangeBuilder); static RangeOption parse(String option); int compareTo(RangeOption that); @Override boolean equals(Object o); @Override int hashCode(); RangeOption nextRange(int pageSize); static final int TERMINAL_END_OF_RANGE; static final int TERMINAL_MISSING; }
@Test public void testToString() throws Exception { RangeOption range = new RangeOption(0, 100); assertThat(range.toString()).isEqualTo("Range=0-100"); range = new RangeOption(0, RangeOption.TERMINAL_END_OF_RANGE); assertThat(range.toString()).isEqualTo("Range=0-*"); range = new RangeOption(0, RangeOption.TERMINAL_MISSING); assertThat(range.toString()).isEqualTo("Range=0"); }