ViewHelper { public static void setBackgroundResource(EfficientCacheView cacheView, int viewId, @DrawableRes int resid) { View view = cacheView.findViewByIdEfficient(viewId); if (view != null) { view.setBackgroundResource(resid); } }  static void setVisibility(EfficientCacheView cacheView, int viewId, int visibility); static void setBackground(EfficientCacheView cacheView, int viewId, Drawable drawable); static void setBackgroundColor(EfficientCacheView cacheView, int viewId,
            @ColorInt int color); static void setBackgroundResource(EfficientCacheView cacheView, int viewId,
            @DrawableRes int resid); static void setTag(EfficientCacheView cacheView, int viewId, Object tag); static void setTag(EfficientCacheView cacheView, int viewId, int key, Object tag); static void setText(EfficientCacheView cacheView, int viewId, CharSequence text); static void setText(EfficientCacheView cacheView, int viewId, @StringRes int resid); static void setTextColor(EfficientCacheView cacheView, int viewId, @ColorInt int color); static void setTextSize(EfficientCacheView cacheView, int viewId, float size); static void setTextSize(EfficientCacheView cacheView, int viewId, int unit, float size); static void setImageResource(EfficientCacheView cacheView, int viewId,
            @DrawableRes int resId); static void setImageDrawable(EfficientCacheView cacheView, int viewId,
            Drawable drawable); static void setImageUri(EfficientCacheView cacheView, int viewId, @Nullable Uri uri); static void setImageBitmap(EfficientCacheView cacheView, int viewId, Bitmap bm);  }
@Test public void testSetBackgroundResource() throws Exception { int drawableRes1 = android.R.drawable.alert_dark_frame; int drawableRes2 = drawableRes1 + 1; int drawableRes3 = drawableRes1 + 2; int drawableRes4 = drawableRes1 + 3; ViewHelper.setBackgroundResource(mCacheView, NULL_VIEW_ID, drawableRes1); ViewHelper.setBackgroundResource(mCacheView, VIEW_ID, drawableRes2); ViewHelper.setBackgroundResource(mCacheView, IMAGEVIEW_ID, drawableRes3); ViewHelper.setBackgroundResource(mCacheView, TEXTVIEW_ID, drawableRes4); verify(mView).setBackgroundResource(drawableRes2); verify(mImageView).setBackgroundResource(drawableRes3); verify(mTextView).setBackgroundResource(drawableRes4); verifyNoMoreInteractions(mView, mImageView, mTextView); }