Null Object Examples  Instances of using the NullObject design
pattern. (...from those who HaveThisPattern.)  A simple example
of NullObject:          class NullOutputStream extends
OutputStream {                 public void write(int b) {
// Do nothing  class NullPrintStream extends PrintStream {
public NullPrintStream() { super(new NullOutputStream()); } }
class Application { private PrintStream debugout; public
Application(PrintStream debugout) { this.debugout = debugout; }
public void go() { int sum = 0; for (int i = 0; i < 10; i++) {
sum += i; debugout.println("i = " + i); }
System.out.println("sum = " + sum); } }   I HaveThisPattern: In
a system that exchanged messages between disconnected systems
via email, I had a "Protocol" object that handled the general
algorithm calling an "email system driver" object to send and
receive email messages via whichever email protocol was in use
on the box. I had drivers for MAPI, VIM, and others.  However,
the most popular and useful protocol for local testing was the
"Null Object"