### Question:
ExpiryDateEditText extends StripeEditText { @VisibleForTesting int updateSelectionIndex( int newLength, int editActionStart, int editActionAddition) { int newPosition, gapsJumped = 0; boolean skipBack = false; if (editActionStart <= 2 && editActionStart + editActionAddition >= 2) { gapsJumped = 1; } if (editActionAddition == 0 && editActionStart == 3) { skipBack = true; } newPosition = editActionStart + editActionAddition + gapsJumped; if (skipBack && newPosition > 0) { newPosition--; } return newPosition <= newLength ? newPosition : newLength; } ExpiryDateEditText(Context context);  ExpiryDateEditText(Context context, AttributeSet attrs);  ExpiryDateEditText(Context context, AttributeSet attrs, int defStyleAttr); boolean isDateValid(); @Nullable @Size(2) int[] getValidDateFields(); void setExpiryDateEditListener(ExpiryDateEditListener expiryDateEditListener);  }### Answer:
@Test public void updateSelectionIndex_whenMovingAcrossTheGap_movesToEnd() { assertEquals(3, mExpiryDateEditText.updateSelectionIndex(3, 1, 1)); }
@Test public void updateSelectionIndex_atStart_onlyMovesForwardByOne() { assertEquals(1, mExpiryDateEditText.updateSelectionIndex(1, 0, 1)); }
@Test public void updateSelectionIndex_whenDeletingAcrossTheGap_staysAtEnd() { assertEquals(2, mExpiryDateEditText.updateSelectionIndex(2, 4, 0)); }