Cappuccino { public static void markAsIdle(@NonNull Object object) { markAsIdle(nameOf(object)); } 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 testMarkAsIdle() throws Exception { CappuccinoResourceWatcher watcher1 = Cappuccino.newIdlingResourceWatcher(ANY_NAME); CappuccinoResourceWatcher watcher2 = Cappuccino.newIdlingResourceWatcher(new Object()); Cappuccino.markAsIdle(ANY_NAME); Cappuccino.markAsIdle(new Object()); assertThat(watcher1.isIdle(), is(true)); assertThat(watcher2.isIdle(), is(true)); }