title: Why HashSet calling compareTo method and causing NullPointerException
body: <p>I am adding values in <code>HashSet</code> and getting <code>NullPointerException</code> in <code>compareTo</code> method.</p>
  
  <pre><code>java.lang.NullPointerException
      at com.fiveIQ.document.Link.compareTo(Link.java:226)
      at com.fiveIQ.document.Link.compareTo(Link.java:16)
      at java.util.HashMap.compareComparables(HashMap.java:371)
      at java.util.HashMap$TreeNode.treeify(HashMap.java:1920)
      at java.util.HashMap.treeifyBin(HashMap.java:771)
      at java.util.HashMap.putVal(HashMap.java:643)
      at java.util.HashMap.put(HashMap.java:611)
      at java.util.HashSet.add(HashSet.java:219)
      at com.fiveIQ.crawlData.parser.EightyLegJsonParser.parse(EightyLegJsonParser.java:51)
      at com.fiveIQ.crawlData.processor.CrawlDataParser.process(CrawlDataParser.java:57)
      at com.fiveIQ.crawlData.processor.CrawlDataUploader.upload(CrawlDataUploader.java:31)
      at com.fiveIQ.crawlData.processor.CrawlDataUploaderExecutor$1.run(CrawlDataUploaderExecutor.java:85)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>Here is my <code>compareTo</code> method. Values of <code>updatedOn</code> is null. But I am not getting why <code>HashSet</code> is calling <code>compareTo</code>?</p>
  
  <pre><code>@Override
  public int compareTo(Link o)
  {
      return o.updatedOn.compareTo(this.getUpdatedOn());
  }
  </code></pre>