ViewHelper { public static void setTag(EfficientCacheView cacheView, int viewId, Object tag) { View view = cacheView.findViewByIdEfficient(viewId); if (view != null) { view.setTag(tag); } }  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 testSetTag() throws Exception { Object tag1 = new Object(); Object tag2 = new Object(); Object tag3 = new Object(); Object tag4 = new Object(); ViewHelper.setTag(mCacheView, NULL_VIEW_ID, tag1); ViewHelper.setTag(mCacheView, VIEW_ID, tag2); ViewHelper.setTag(mCacheView, IMAGEVIEW_ID, tag3); ViewHelper.setTag(mCacheView, TEXTVIEW_ID, tag4); verify(mView).setTag(tag2); verify(mImageView).setTag(tag3); verify(mTextView).setTag(tag4); verifyNoMoreInteractions(mView, mImageView, mTextView); }
@Test public void testSetTagWithTag() throws Exception { int tagId1 = 1; int tagId2 = 2; int tagId3 = 3; int tagId4 = 4; Object tag1 = new Object(); Object tag2 = new Object(); Object tag3 = new Object(); Object tag4 = new Object(); ViewHelper.setTag(mCacheView, NULL_VIEW_ID, tagId1, tag1); ViewHelper.setTag(mCacheView, VIEW_ID, tagId2, tag2); ViewHelper.setTag(mCacheView, IMAGEVIEW_ID, tagId3, tag3); ViewHelper.setTag(mCacheView, TEXTVIEW_ID, tagId4, tag4); verify(mView).setTag(tagId2, tag2); verify(mImageView).setTag(tagId3, tag3); verify(mTextView).setTag(tagId4, tag4); verifyNoMoreInteractions(mView, mImageView, mTextView); }