Timber { public static void plant(Tree tree) { if (tree == null) { throw new NullPointerException("tree == null"); } if (tree == TREE_OF_SOULS) { throw new IllegalArgumentException("Cannot plant Timber into itself."); } synchronized (FOREST) { FOREST.add(tree); forestAsArray = FOREST.toArray(new Tree[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 nullTree() { try { Timber.plant(null); fail(); } catch (NullPointerException e) { assertThat(e).hasMessage("tree == null"); } }