CountryCodeEditText extends ErrorEditText { public String getCountryCode() { return getText().toString().replaceAll("[^\\d]", ""); } CountryCodeEditText(Context context);  CountryCodeEditText(Context context, AttributeSet attrs);  CountryCodeEditText(Context context, AttributeSet attrs, int defStyle); String getCountryCode(); @Override boolean isValid(); @Override String getErrorMessage();  }
@Test public void getCountryCode_returnsStrippedCountryCode() { mView.setText("+86"); assertEquals("86", mView.getCountryCode()); }