code: @Override
      public Presentation deserialize(JsonElement element, Type type, JsonDeserializationContext context)
          throws JsonParseException
      {
          JsonObject obj = element.getAsJsonObject();
  
          // Check for a threshold presentation
          JsonElement threshold = obj.get("threshold");
          if(threshold != null)
              return gson.fromJson(obj, ThresholdPresentation.class);
  
          // Check for a drilldown presentation
          JsonElement drilldownDashboardId = obj.get("drilldown_dashboard_id");
          if(drilldownDashboardId != null)
              return gson.fromJson(obj, DrilldownPresentation.class);
  
          // Check for a traffic light presentation
          JsonElement trafficLights = obj.get("traffic_lights");
          if(trafficLights != null)
              return gson.fromJson(obj, TrafficLightPresentation.class);
  
          return gson.fromJson(obj, Presentation.class);
      }
docs: Gson invokes this call-back method during deserialization when it encounters a field of the specified type.
  @param element The Json data being deserialized
  @param type The type of the Object to deserialize to
  @param context The JSON deserialization context
  @return The widget presentation