OffsetData extends DataWrapper<T> { @NonNull @Override public T get(int position, int flags) { if (position < 0) { throw new IndexOutOfBoundsException(); } return mData.get(position + mOffset, flags); } OffsetData(@NonNull Data<? extends T> data, int offset); int getOffset(); void setOffset(int offset); @NonNull @Override T get(int position, int flags); @Override int size();  }
@Test(expected = IndexOutOfBoundsException.class) public void getOutOfBoundsThrows() { mOffsetData.get(6); }
@Test(expected = IndexOutOfBoundsException.class) public void getNegativeThrows() { mOffsetData.get(-3); }