AccordionList implements Iterable<RangedValue<T>> { public void remove(int entryIndex) { int offset = -mRangeList.get(entryIndex).mRange.getSize(); mRangeList.remove(entryIndex); for (int i = entryIndex; i < mRangeList.size(); i++) { mRangeList.set(i, mRangeList.get(i).offset(offset)); } }  @NonNull @Override Iterator<RangedValue<T>> iterator(); @Override int hashCode(); @Override boolean equals(Object object); @NonNull T valueAt(int location); @NonNull RangedValue<T> rangedValueAt(int location); @NonNull RangedValue<T> get(int entryIndex); @NonNull Range span(); int size(); boolean isEmpty(); void add(@NonNull T value, int size); void add(int entryIndex, @NonNull T value, int size); void addAll(@NonNull AccordionList<T> values); void set(int entryIndex, @NonNull T value, int size); void clear(); void remove(int entryIndex);  }
@Test(expected = IndexOutOfBoundsException.class) public void test_RemoveOutOfBounds() { AccordionList<String> list = new AccordionList<>(); list.remove(2); }