CardEditText extends ErrorEditText implements TextWatcher { public void setMask(boolean mask) { mMask = mask; } CardEditText(Context context);  CardEditText(Context context, AttributeSet attrs);  CardEditText(Context context, AttributeSet attrs, int defStyle); void displayCardTypeIcon(boolean display); CardType getCardType(); void setMask(boolean mask); void setOnCardTypeChangedListener(OnCardTypeChangedListener listener); @Override void afterTextChanged(Editable editable); @Override boolean isValid(); @Override String getErrorMessage(); @Override void beforeTextChanged(CharSequence s, int start, int count, int after);  }
@Test public void doesNotMaskIfFieldIsInvalid() { TransformationMethod originalMethod = mView.getTransformationMethod(); mView.setMask(true); type("4111111111111112"); assertEquals(originalMethod, mView.getTransformationMethod()); }