Log { public void debug(String format, Object... args) { if (mVerbose) { info(format, args); } }  void setVerbose(boolean verbose); void debug(String format, Object... args); void debugNoln(String format, Object... args); void info(String format, Object... args); void error(String format, Object... args); void exception(Throwable t, String format, Object... args);  }
@Test public void testDebug() { assertEquals("", mLog.getOut()); assertEquals("", mLog.getErr()); mLog.setVerbose(false); mLog.debug("Test %d", 42); assertEquals("", mLog.getOut()); mLog.setVerbose(true); mLog.debug("Test %d", 42); assertEquals("Test 42\n", mLog.getOut()); assertEquals("", mLog.getErr()); }