title: Empty json object instead of null, when no data -> how to deserialize with gson
body: <p>I am trying to parse json data with Google's gson library. But the json data doesn't behave well.</p>
  
  <p>It does look like this when everything is alright:</p>
  
  <pre><code>{
      "parent": {
          "child_one": "some String",
          "child_two": "4711",
          ...
      }
  }
  </code></pre>
  
  <p><code>child_one</code> should be parsed as <code>String</code>, <code>child_two</code> as <code>int</code>. 
  But sometimes one of the children has no values what results in an empty object instead of <code>null</code>, like this:</p>
  
  <pre><code>{
      "parent": {
          "child_one": "some String",
          "child_two": {},
          ...
      }
  }
  </code></pre>
  
  <p>I have no access to alter the json feed, so I have to deal with it during deserialization.
  But I am lost here. If I just let it parse the 2nd case gives me a <code>JsonSyntaxException</code>.</p>
  
  <p><strong>I thought about using a custom <code>JsonDeserializer</code>. Do there something like inspect every element if it is a <code>JsonObject</code> and if it is, check if the <code>entrySet.isEmpty()</code>. If yes, remove that element.</strong>
  But I have no idea how to accomplish the iterating...</p>