IntCharSet implements Iterable<Integer> { @Override public String toString() { StringBuilder result = new StringBuilder("{ "); for (Interval interval : intervals) { result.append(interval); } result.append(" }"); return result.toString(); }  static IntCharSet of(Interval interval); static IntCharSet of(Interval... intervals); static IntCharSet ofCharacterRange(int start, int end); static IntCharSet ofCharacter(int singleChar); static IntCharSet allChars(); static IntCharSet nlChars(); @SuppressWarnings("ReferenceEquality") void add(IntCharSet set); @SuppressWarnings("IncrementInForLoopAndHeader") void add(Interval interval); void add(int c); boolean contains(int singleChar); boolean contains(IntCharSet other); @Override boolean equals(Object o); @Override int hashCode(); IntCharSet and(IntCharSet set); @SuppressWarnings("ReferenceEquality") void sub(IntCharSet set); static IntCharSet complementOf(IntCharSet x); boolean containsElements(); int numIntervals(); List<Interval> getIntervals(); Iterator<Interval> intervalIterator(); IntCharSet getCaseless(UnicodeProperties unicodeProperties); @Override String toString(); static IntCharSet copyOf(IntCharSet intCharSet); int size(); @Override IntCharSetIterator iterator();  }
@Test public void testToString() { IntCharSet set = IntCharSet.of( new Interval('A', 'C'), new Interval('H', 'O'), new Interval('a', 'c'), new Interval('h', 'o'), new Interval('İ', 'ı'), Interval.ofCharacter('K') ); assertThat(set.toString()).isEqualTo("{ ['A'-'C']['H'-'O']['a'-'c']['h'-'o'][304-305][8490] }"); }