### Question:
ArrayListOfShortsWritable extends ArrayListOfShorts implements
    WritableComparable<ArrayListOfShortsWritable> { @Override public String toString() { return toString(size()); } ArrayListOfShortsWritable();  ArrayListOfShortsWritable(int initialCapacity);  ArrayListOfShortsWritable(short first, short last);  ArrayListOfShortsWritable(ArrayListOfShortsWritable other);  ArrayListOfShortsWritable(short[] arr); void readFields(DataInput in); void write(DataOutput out); @Override String toString(); static ArrayListOfShortsWritable fromArrayListOfShorts(ArrayListOfShorts a); @Override int compareTo(ArrayListOfShortsWritable obj);  }### Answer:
@Test public void testToString() { assertEquals("[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", new ArrayListOfShortsWritable((short) 1, (short) 11).toString()); assertEquals("[1, 2, 3, 4, 5 ... (5 more) ]", new ArrayListOfShortsWritable((short) 1, (short) 11).toString(5)); assertEquals("[1, 2, 3, 4, 5]", new ArrayListOfShortsWritable((short) 1, (short) 6).toString()); assertEquals("[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]", new ArrayListOfShortsWritable((short) 1, (short) 12).toString()); assertEquals("[]", new ArrayListOfShortsWritable().toString()); }