PriorityView extends RelativeLayout { public void select() { mTitle.setTextColor(ContextCompat.getColor(getContext(), mTitleColor)); mBackground.setVisibility(VISIBLE); mBackgroundDisable.setVisibility(GONE); } PriorityView(Context context, AttributeSet attrs);  PriorityView(Context context, AttributeSet attrs, int defStyleAttr); Priority getPriority(); void select(); void unSelect(); void setPriority(Priority priority);  }
@Test public void testSelect() throws Exception { mPriorityView.setPriority(Priority.HIGH); mPriorityView.select(); assertTextViewColor(mTitle, android.R.color.white); assertEquals(View.VISIBLE, mBackground.getVisibility()); assertEquals(View.GONE, mBackgroundDisable.getVisibility()); }