@Test public void add2() { BufferInt coll = new BufferInt(); for (int i = 0; i < 11; i++) { coll.addInt(i); } ListInt reference = new ArrayInt(new int[] {0, 1,2,3,4,5,6,7,8,9,10}); assertThat(coll, equalTo(reference)); }
public void addInt(int value) { data[endOffset] = value; endOffset++; if (endOffset == data.length) resize(); }
BufferInt extends ListInt { public void addInt(int value) { data[endOffset] = value; endOffset++; if (endOffset == data.length) resize(); } }
BufferInt extends ListInt { public void addInt(int value) { data[endOffset] = value; endOffset++; if (endOffset == data.length) resize(); } BufferInt();  BufferInt(int initialCapacity); }
BufferInt extends ListInt { public void addInt(int value) { data[endOffset] = value; endOffset++; if (endOffset == data.length) resize(); } BufferInt();  BufferInt(int initialCapacity); @Override int getInt(int index); @Override int size(); void addInt(int value); void clear(); int getCurrentCapacity(); }
BufferInt extends ListInt { public void addInt(int value) { data[endOffset] = value; endOffset++; if (endOffset == data.length) resize(); } BufferInt();  BufferInt(int initialCapacity); @Override int getInt(int index); @Override int size(); void addInt(int value); void clear(); int getCurrentCapacity();  }