code: private void parseEvent(JsonObject event, Parser parser, int i) {
  
          JsonElement nameJE = event.get(Event.KEY_NAME);
  
          if (nameJE != null) {
  
              String name = nameJE.getAsString();
  
              if (MessageSentEvent.TYPE.equals(name)) {
                  MessageSentEvent parsed = parser.parse(event, MessageSentEvent.class);
                  messageSent.add(parsed);
                  map.put(i, parsed);
              } else if (MessageDeliveredEvent.TYPE.equals(name)) {
                  MessageDeliveredEvent parsed = parser.parse(event, MessageDeliveredEvent.class);
                  messageDelivered.add(parsed);
                  map.put(i, parsed);
              } else if (MessageReadEvent.TYPE.equals(name)) {
                  MessageReadEvent parsed = parser.parse(event, MessageReadEvent.class);
                  messageRead.add(parsed);
                  map.put(i, parsed);
              }
          }
      }
docs: Parse event and add to appropriate list.
  
  @param event  Json object to parse.
  @param parser Parser interface.
  @param i      Number of event in the json array.