RangeBand implements Predicate<T> { @Override public String toString() { return new StringBuilder() .append(getLow() == null ? "*" : getLow()) .append(" - ") .append(getHigh() == null ? "*" : getHigh()) .toString(); } RangeBand(T low, T high); boolean contains(T item); @Override boolean test(T t); T getLow(); T getHigh(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void looksPretty() { assertEquals("0 - *", new RangeBand<>(0, null).toString()); assertEquals("* - 10", new RangeBand<>(null, 10).toString()); assertEquals("0 - 10", new RangeBand<>(0, 10).toString()); }