### Question:
ErrorView extends LinearLayout { public void setButton(@Nullable final String buttonLabel, @Nullable final OnClickListener onClickListener) { if (buttonLabel == null || onClickListener == null) { button.setText(null); button.setVisibility(GONE); } else { button.setText(buttonLabel); button.setOnClickListener(onClickListener); button.setVisibility(VISIBLE); } buttonClickListener = onClickListener; } ErrorView(final Context context);  ErrorView(final Context context, final AttributeSet attrs);  ErrorView(final Context context, final AttributeSet attrs, final int defStyleAttr); @TargetApi(Build.VERSION_CODES.LOLLIPOP)  ErrorView(final Context context, final AttributeSet attrs, final int defStyleAttr, final int defStyleRes); void setImage(@DrawableRes final int drawable); void setImage(@DrawableRes final int drawable, @Nullable final String contentDescription); void setTitle(@Nullable final String titleText); void setTitle(@StringRes final int resId); void setSubtitle(@Nullable final String subtitleText); void setSubtitle(@StringRes final int resId); void setButton(@Nullable final String buttonLabel, @Nullable final OnClickListener onClickListener); void setButton(@StringRes final int resId, @Nullable final OnClickListener onClickListener); @Override String toString();  }### Answer:
@Test public void testCustomButton() { assertEquals("The ErrorView button should be gone", View.GONE, button.getVisibility()); errorView.setButton(null, null); assertEquals("The ErrorView button should be gone", View.GONE, button.getVisibility()); errorView.setButton(TEST_TEXT, mock(View.OnClickListener.class)); assertEquals("The ErrorView button should be visible", View.VISIBLE, button.getVisibility()); }