title: FreeMarker: Check if map value is null
body: <p>I have a Map whose key and value and custom classes. The key class is called <code>Position</code> and is instantiated with two int (for example <code>new Position(2, 4)</code>.</p>
  
  <p>I got rid of this Position class and converted the map to a <code>SimpleHash</code> in order to use it with Freemarker. I now have a <code>SimpleHash</code> whose key is a String remapping Position values (for example <code>"2 4"</code>) and whose value is either <code>null</code> or a <code>Lot</code> (custom) class.</p>
  
  <p>In the template I need to check if the value of a given item in the SimpleMap (passed as <code>map</code>) is either null or a Lot instance.</p>
  
  <pre><code>        &lt;#list mapMinY..mapMaxY as y&gt;
              &lt;tr&gt;
                  &lt;#list mapMinX..mapMaxX as x&gt;
                      &lt;td&gt;
                          &lt;div&gt;
                              &lt;!-- Check if map[x + " " + y] is null --&gt;
                              ${x}, ${y}
                          &lt;/div&gt;
                      &lt;/td&gt;
                  &lt;/#list&gt;
              &lt;/tr&gt;
          &lt;/#list&gt;
  </code></pre>
  
  <p>How to do this?  </p>