### Question:
SpacedEditText extends AppCompatEditText { @Override public void setText(CharSequence text, BufferType type) { originalText = new SpannableStringBuilder(text); final SpannableStringBuilder spacedOutString = getSpacedOutString(text); super.setText(spacedOutString, BufferType.SPANNABLE); } SpacedEditText(Context context);  SpacedEditText(Context context, AttributeSet attrs); @Override void setText(CharSequence text, BufferType type); @Override void setSelection(int index); Editable getUnspacedText();  }### Answer:
@Test public void testSpacedEditText_setTextEmpty() throws Exception { spacedEditText.setText(""); testSpacing("", "", spacedEditText); }
@Test public void testSpacedEditText_setTextNonEmpty() throws Exception { spacedEditText.setText("123456"); testSpacing("1 2 3 4 5 6", "123456", spacedEditText); }
@Test public void testSpacedEditText_setTextWithOneCharacter() throws Exception { spacedEditText.setText("1"); testSpacing("1", "1", spacedEditText); }
@Test public void testSpacedEditText_setTextWithExistingSpaces() throws Exception { spacedEditText.setText("1 2 3"); testSpacing("1 2 3", "1 2 3", spacedEditText); }