Timber { public static int treeCount() { synchronized (FOREST) { return FOREST.size(); } } private  Timber(); static void v(@NonNls String message, Object... args); static void v(Throwable t, @NonNls String message, Object... args); static void d(@NonNls String message, Object... args); static void d(Throwable t, @NonNls String message, Object... args); static void i(@NonNls String message, Object... args); static void i(Throwable t, @NonNls String message, Object... args); static void w(@NonNls String message, Object... args); static void w(Throwable t, @NonNls String message, Object... args); static void e(@NonNls String message, Object... args); static void e(Throwable t, @NonNls String message, Object... args); static void wtf(@NonNls String message, Object... args); static void wtf(Throwable t, @NonNls String message, Object... args); static void log(int priority, @NonNls String message, Object... args); static void log(int priority, Throwable t, @NonNls String message, Object... args); static Tree asTree(); static Tree tag(String tag); static void plant(Tree tree); static void uproot(Tree tree); static void uprootAll(); static List<Tree> forest(); static int treeCount();  }
@Test public void treeCount() { assertThat(Timber.treeCount()).isEqualTo(0); for(int i= 1 ; i < 50 ; i++){ Timber.plant(new Timber.DebugTree()); assertThat(Timber.treeCount()).isEqualTo(i); } Timber.uprootAll(); assertThat(Timber.treeCount()).isEqualTo(0); }