Log { public static void disable() { setDisabled(true); }  static void print(String message); static void print(Object message); static void printLine(String message); static void printLine(); static void printConcat(Object... messages); static void printConcatLine(Object... messages); static void printLine(Object message); static void format(String format, Object... args); static void formatLine(String format, Object... args); static void setOutput(OutputStream _output); static OutputStream getOutput(); static void setDisabled(boolean _disabled); static boolean isDisabled(); static void disable(); static void enable();  }
@Test public void testDisable() throws IOException { OUTPUT.reset(); assertFalse(Log.isDisabled()); Log.print("test test"); assertEquals("test test", OUTPUT.toString()); OUTPUT.reset(); Log.printLine("test test"); assertEquals("test test" + LINE_SEPARATOR, OUTPUT.toString()); OUTPUT.reset(); Log.format("test %s test", "test"); assertEquals("test test test", OUTPUT.toString()); OUTPUT.reset(); Log.formatLine("test %s test", "test"); assertEquals("test test test" + LINE_SEPARATOR, OUTPUT.toString()); OUTPUT.reset(); Log.disable(); assertTrue(Log.isDisabled()); Log.print("test test"); assertEquals("", OUTPUT.toString()); OUTPUT.reset(); Log.printLine("test test"); assertEquals("", OUTPUT.toString()); OUTPUT.reset(); Log.format("test %s test", "test"); assertEquals("", OUTPUT.toString()); OUTPUT.reset(); Log.formatLine("test %s test", "test"); assertEquals("", OUTPUT.toString()); OUTPUT.reset(); Log.enable(); assertFalse(Log.isDisabled()); Log.print("test test"); assertEquals("test test", OUTPUT.toString()); OUTPUT.reset(); Log.printLine("test test"); assertEquals("test test" + LINE_SEPARATOR, OUTPUT.toString()); OUTPUT.reset(); Log.format("test %s test", "test"); assertEquals("test test test", OUTPUT.toString()); OUTPUT.reset(); Log.formatLine("test %s test", "test"); assertEquals("test test test" + LINE_SEPARATOR, OUTPUT.toString()); OUTPUT.reset(); }