title: Android Firebase - Why Null Values in Map fields are ignored
body: <p>I discovered when saving a POJO with a map field using Firebase on Android, that if that map contains nulls in the value property of that map, then the whole field is ignored.</p>
  
  <p>The workaround is easy (non-null values will result in the map saving successfully), but I want to understand why is this so?</p>
  
  <p><strong>Model</strong></p>
  
  <pre><code>public class Game {
  
      private String owner;
      private Map&lt;String, String&gt; characters;
  
      public Game() {
          // empty constructor for Firebase
      }
  
      public String getOwner() {
          return owner;
      }
  
      public void setOwner(String owner) {
          this.owner = owner;
      }
  
      public Map&lt;String, String&gt; getCharacters() {
          return characters;
      }
  
      public void setCharacters(Map&lt;String, String&gt; characters) {
          this.characters = characters;
      }
  }
  </code></pre>
  
  <p><strong>Calling code</strong></p>
  
  <pre><code>final Game game = new Game();
          game.setOwner("owner");
          game.setCharacters(new HashMap&lt;String, String&gt;());
          game.getCharacters().put("Bugs Bunny", null);
          game.getCharacters().put("Batman", null);
          final Firebase ref = new Firebase("&lt;firebaseurl&gt;/test/" + System.currentTimeMillis());
          ref.setValue(game);
  </code></pre>
  
  <p><strong>Resulting object in Firebase</strong></p>
  
  <pre><code>{
      "1456421340781": {
          "owner": "owner"
      }
  }
  </code></pre>