@Test public void hasPrintWriter(){ PrintStream writer = toTest.getWriter(); assertNotNull(writer); }
public PrintStream getWriter() { return new PrintStream(new OutputStream() { private final StringBuilder builder = new StringBuilder(); @Override public void write(int b) throws IOException { builder.append((char)b); } @Override public void flush() throws IOException{ super.flush(); text += builder.toString(); builder.delete(0,builder.length()); events.invoker().invoke(); } },true); }
TextViewModel { public PrintStream getWriter() { return new PrintStream(new OutputStream() { private final StringBuilder builder = new StringBuilder(); @Override public void write(int b) throws IOException { builder.append((char)b); } @Override public void flush() throws IOException{ super.flush(); text += builder.toString(); builder.delete(0,builder.length()); events.invoker().invoke(); } },true); } }
TextViewModel { public PrintStream getWriter() { return new PrintStream(new OutputStream() { private final StringBuilder builder = new StringBuilder(); @Override public void write(int b) throws IOException { builder.append((char)b); } @Override public void flush() throws IOException{ super.flush(); text += builder.toString(); builder.delete(0,builder.length()); events.invoker().invoke(); } },true); }  }
TextViewModel { public PrintStream getWriter() { return new PrintStream(new OutputStream() { private final StringBuilder builder = new StringBuilder(); @Override public void write(int b) throws IOException { builder.append((char)b); } @Override public void flush() throws IOException{ super.flush(); text += builder.toString(); builder.delete(0,builder.length()); events.invoker().invoke(); } },true); }  String getText(); PrintStream getWriter(); void clear(); Disposable addEventListener(NoArgAction event); }
TextViewModel { public PrintStream getWriter() { return new PrintStream(new OutputStream() { private final StringBuilder builder = new StringBuilder(); @Override public void write(int b) throws IOException { builder.append((char)b); } @Override public void flush() throws IOException{ super.flush(); text += builder.toString(); builder.delete(0,builder.length()); events.invoker().invoke(); } },true); }  String getText(); PrintStream getWriter(); void clear(); Disposable addEventListener(NoArgAction event);  }