Cappuccino { public static void setTagForTesting(@NonNull View view, @Nullable Object tag) { view.setTag(tag); } private  Cappuccino(); @NonNull static CappuccinoResourceWatcher newIdlingResourceWatcher(@NonNull Object resource); @NonNull static CappuccinoResourceWatcher newIdlingResourceWatcher(@NonNull String name); @NonNull static String nameOf(@NonNull Object object); @NonNull static CappuccinoResourceWatcher getResourceWatcher(@NonNull Object object); @NonNull static CappuccinoResourceWatcher getResourceWatcher(@NonNull String name); static void markAsBusy(@NonNull Object object); static void markAsBusy(@NonNull String name); static void markAsIdle(@NonNull Object object); static void markAsIdle(@NonNull String name); static void registerIdlingResource(@NonNull Object object); static void registerIdlingResource(@NonNull String name); static void unregisterIdlingResource(@NonNull Object object); static void unregisterIdlingResource(@NonNull String name); static void reset(); static void setTagForTesting(@NonNull View view, @Nullable Object tag); static void setTagForTesting(@NonNull View view, @IdRes int key, @Nullable Object tag);  }
@Test public void testSetTagSetsTag() throws Exception { View mockView1 = Mockito.mock(View.class); Cappuccino.setTagForTesting(mockView1, "tag"); verify(mockView1).setTag("tag"); View mockView2 = Mockito.mock(View.class); Cappuccino.setTagForTesting(mockView2, 1, "tag"); verify(mockView2).setTag(1, "tag"); }