@Test(expected=NoSuchElementException.class) public void testPopWriterThrowsNoSuchElementException() { Printer printer = new Printer(new StringWriter()); printer.popWriter(); }
public Writer popWriter() { printWriter.flush(); persistentPrintWriter.flush(); final Writer oldInternal = this.internalWriter; StackEntry e = stack.pop(); this.internalWriter = e.internal; this.printWriter = e.wrapped; this.atStartOfLine = e.atStartOfLine; teeWriter = null; return oldInternal; }
Printer { public Writer popWriter() { printWriter.flush(); persistentPrintWriter.flush(); final Writer oldInternal = this.internalWriter; StackEntry e = stack.pop(); this.internalWriter = e.internal; this.printWriter = e.wrapped; this.atStartOfLine = e.atStartOfLine; teeWriter = null; return oldInternal; } }
Printer { public Writer popWriter() { printWriter.flush(); persistentPrintWriter.flush(); final Writer oldInternal = this.internalWriter; StackEntry e = stack.pop(); this.internalWriter = e.internal; this.printWriter = e.wrapped; this.atStartOfLine = e.atStartOfLine; teeWriter = null; return oldInternal; } Printer(Writer writer); }
Printer { public Writer popWriter() { printWriter.flush(); persistentPrintWriter.flush(); final Writer oldInternal = this.internalWriter; StackEntry e = stack.pop(); this.internalWriter = e.internal; this.printWriter = e.wrapped; this.atStartOfLine = e.atStartOfLine; teeWriter = null; return oldInternal; } Printer(Writer writer); static Printer createStdOutPrinter(); Writer getWriter(); void pushWriter(Writer writer); PrintWriter asPrintWriter(); Writer popWriter(); void addPersistentWriter(Writer writer); void removePersistentWriter(Writer writer); Printer print(String output); Printer print(String format, Object ... args); Formatter asFormatter(); Printer startNewLine(); Printer flush(); Printer warn(String message); Printer warn(String format, Object ... args); boolean isPrintWarnings(); Printer setPrintWarnings(boolean printWarnings); Printer error(String message); Printer error(String format, Object ... args); Printer spaces(int n); List<String> getWarningsAndClear(); }
Printer { public Writer popWriter() { printWriter.flush(); persistentPrintWriter.flush(); final Writer oldInternal = this.internalWriter; StackEntry e = stack.pop(); this.internalWriter = e.internal; this.printWriter = e.wrapped; this.atStartOfLine = e.atStartOfLine; teeWriter = null; return oldInternal; } Printer(Writer writer); static Printer createStdOutPrinter(); Writer getWriter(); void pushWriter(Writer writer); PrintWriter asPrintWriter(); Writer popWriter(); void addPersistentWriter(Writer writer); void removePersistentWriter(Writer writer); Printer print(String output); Printer print(String format, Object ... args); Formatter asFormatter(); Printer startNewLine(); Printer flush(); Printer warn(String message); Printer warn(String format, Object ... args); boolean isPrintWarnings(); Printer setPrintWarnings(boolean printWarnings); Printer error(String message); Printer error(String format, Object ... args); Printer spaces(int n); List<String> getWarningsAndClear();  }