ContentRange implements Serializable { @Override public String toString() { return "Xing-Content-Range: items " + (offset < 0 || last < 0 ? "*" : offset + "-" + last) + '/' + (total >= 0 ? total : "*"); } ContentRange(int offset, int last, int total); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); int offset(); int last(); int total(); boolean isEmpty();  }
@Test public void prettyPrinted() throws Exception { ContentRange range1 = new ContentRange(1, 3, 10); assertThat(range1.toString()).isEqualTo("Xing-Content-Range: items 1-3/10"); ContentRange range2 = new ContentRange(1, 4, -1); assertThat(range2.toString()).isEqualTo("Xing-Content-Range: items 1-40"); }