title: Check object empty
body: <p>Basically how do you check if an object is null or empty.  What I mean is that if I have an object instantiated but all its values or fields are null, the how do I check in code if it is empty?</p>
  
  <p>I have tried;</p>
  
  <pre><code>if (doc != null){
  .... do something
  </code></pre>
  
  <p>But it doesn't seem to work.</p>