Chip extends LinearLayout { public void setText(String text) { chipText.setText(text); } Chip(Context context);  Chip(Context context, AttributeSet attrs);  Chip(Context context, AttributeSet attrs, int defStyleAttr); @TargetApi(Build.VERSION_CODES.LOLLIPOP)  Chip(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes); @OnClick(R.id.delete_chip) void deleteChip(); void setText(String text); String getChipText(); void setOnDeleteListener(OnDeleteListener onDeleteListener);  }
@Test public void shouldSetChipText() { String chipText = "Hot Chips!"; chip.setText(chipText); TextView chipTextView = (TextView) chip.findViewById(R.id.chip_text); assertEquals(chipText, chipTextView.getText().toString()); }