@Test public void testEstablishRange() { mRange = new Range(0, mSpy); mRange.extendRange(5, TYPE_PRIMARY); mOperations.pop().assertChanged(1, 5, true); }
private void establishRange(int position, @RangeType int type) { checkArgument(mEnd == NO_POSITION, "End has already been set."); mEnd = position; if (position > mBegin) { if (DEBUG) log(type, "Establishing initial range at @ " + position); updateRange(mBegin + 1, position, true, type); } else if (position < mBegin) { if (DEBUG) log(type, "Establishing initial range at @ " + position); updateRange(position, mBegin - 1, true, type); } }
Range { private void establishRange(int position, @RangeType int type) { checkArgument(mEnd == NO_POSITION, "End has already been set."); mEnd = position; if (position > mBegin) { if (DEBUG) log(type, "Establishing initial range at @ " + position); updateRange(mBegin + 1, position, true, type); } else if (position < mBegin) { if (DEBUG) log(type, "Establishing initial range at @ " + position); updateRange(position, mBegin - 1, true, type); } } }
Range { private void establishRange(int position, @RangeType int type) { checkArgument(mEnd == NO_POSITION, "End has already been set."); mEnd = position; if (position > mBegin) { if (DEBUG) log(type, "Establishing initial range at @ " + position); updateRange(mBegin + 1, position, true, type); } else if (position < mBegin) { if (DEBUG) log(type, "Establishing initial range at @ " + position); updateRange(position, mBegin - 1, true, type); } } Range(int position, @NonNull Callbacks callbacks); }
Range { private void establishRange(int position, @RangeType int type) { checkArgument(mEnd == NO_POSITION, "End has already been set."); mEnd = position; if (position > mBegin) { if (DEBUG) log(type, "Establishing initial range at @ " + position); updateRange(mBegin + 1, position, true, type); } else if (position < mBegin) { if (DEBUG) log(type, "Establishing initial range at @ " + position); updateRange(position, mBegin - 1, true, type); } } Range(int position, @NonNull Callbacks callbacks); @Override String toString(); }
Range { private void establishRange(int position, @RangeType int type) { checkArgument(mEnd == NO_POSITION, "End has already been set."); mEnd = position; if (position > mBegin) { if (DEBUG) log(type, "Establishing initial range at @ " + position); updateRange(mBegin + 1, position, true, type); } else if (position < mBegin) { if (DEBUG) log(type, "Establishing initial range at @ " + position); updateRange(position, mBegin - 1, true, type); } } Range(int position, @NonNull Callbacks callbacks); @Override String toString();  }