EntitySet { @Override public String toString() { IntBag indices = getIndices(); if (size() == 0) { return "[]"; } StringBuilder builder = new StringBuilder(); builder.append('['); int[] buffer = indices.buffer; builder.append(buffer[0]); for (int i = 1, n = size(); i < n; i++) { builder.append(','); builder.append(' '); builder.append(buffer[i]); } builder.append(']'); return builder.toString(); } EntitySet();  EntitySet(EntitySet set); private  EntitySet(EntitySetContent content); EntitySetEdit edit(); EntitySet view(); boolean contains(int entity); Mask getMask(); IntBag getIndices(); int size(); boolean isEmpty(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }
@Test public void testToString() { EntitySet set = new EntitySet(); assertEquals("[]", set.toString()); set.edit().addEntity(0); assertEquals("[0]", set.toString()); set.edit().addEntity(4); assertEquals("[0, 4]", set.toString()); set.edit().addEntity(2); assertEquals("[0, 2, 4]", set.toString()); }