title: What is the purpose of the NullObject class in Groovy?
body: <p>I've been using Groovy for all of five hours and just came across the <a href="http://groovy.codehaus.org/api/index.html?org/codehaus/groovy/runtime/NullObject.html" rel="noreferrer">Groovy <code>NullObject</code></a>.  I read the Groovy <a href="http://groovy.codehaus.org/Null+Object+Pattern" rel="noreferrer">explanation of the Null Object Pattern</a>, but it doesn't touch on the <code>NullObject</code> class directly; is <code>NullObject</code> merely intended to be a base class for things like <code>NullTree</code> and <code>NullJob</code>?  I'm getting a <code>NullObject</code> back in some code that expects a <code>String</code>, and it's causing a failure much like a "regular" <code>null</code> would have.</p>
  
  <p>So, what is the purpose of <code>NullObject</code>?  Or, phrased differently, what value does <code>NullObject</code> offer that "regular" <code>null</code> doesn't?</p>