code: @Override
    public EventData deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
        throws JsonParseException {
      EventData eventData = new EventData();
      JsonObject jsonObject = json.getAsJsonObject();
      for (Map.Entry<String, JsonElement> entry : jsonObject.entrySet()) {
        String key = entry.getKey();
        JsonElement element = entry.getValue();
        if ("previous_attributes".equals(key)) {
          if (element.isJsonNull()) {
            eventData.setPreviousAttributes(null);
          } else if (element.isJsonObject()) {
            Map<String, Object> previousAttributes =
                UNTYPED_MAP_DESERIALIZER.deserialize(element.getAsJsonObject());
            eventData.setPreviousAttributes(previousAttributes);
          }
        } else if ("object".equals(key)) {
          eventData.setObject(entry.getValue().getAsJsonObject());
        }
      }
      return eventData;
    }
docs: Deserializes the JSON payload contained in an event's {@code data} attribute into an
  {@link EventData} instance.