@Test public void testOutOfIndex(){ assertNull(data.get(-5)); assertNull(data.get(42)); }
public Integer get(int index) { if(index < 0 || index >= size){ return null; } return data[index]; }
MyArrayListInteger { public Integer get(int index) { if(index < 0 || index >= size){ return null; } return data[index]; } }
MyArrayListInteger { public Integer get(int index) { if(index < 0 || index >= size){ return null; } return data[index]; } MyArrayListInteger();  MyArrayListInteger(int maxSize); }
MyArrayListInteger { public Integer get(int index) { if(index < 0 || index >= size){ return null; } return data[index]; } MyArrayListInteger();  MyArrayListInteger(int maxSize); Integer get(int index); void add(Integer value); int size(); }
MyArrayListInteger { public Integer get(int index) { if(index < 0 || index >= size){ return null; } return data[index]; } MyArrayListInteger();  MyArrayListInteger(int maxSize); Integer get(int index); void add(Integer value); int size();  }