FilterData extends DataWrapper<T> { @NonNull @Override public T get(int position, int flags) { if (position < 0 || position >= mIndex.size()) { throw new IndexOutOfBoundsException(format("Position %s, size %s", position, mIndex.size())); } int innerSize = mData.size(); int innerPosition = mIndex.outerToInner(position); if (innerPosition < 0 || innerPosition >= innerSize) { throw new AssertionError( format("Index inconsistency: index entry at position %s points to inner position %s, but inner data size is %s. The inner data content may have changed without a corresponding change notification.", position, innerPosition, innerSize)); } return mData.get(innerPosition, flags); } FilterData(@NonNull Data<? extends T> data);  FilterData(@NonNull Data<? extends T> data, @NonNull Predicate<? super T> predicate); @NonNull Predicate<? super T> getPredicate(); void setPredicate(@NonNull Predicate<? super T> predicate); @Override int size(); @NonNull @Override T get(int position, int flags);  }
@Test(expected = IndexOutOfBoundsException.class) public void invalidGetIndexThrowsIndexOutOfBounds() { mFilterData.get(5); }