class Serializer {

  public static <T> T deserialize(Map<String, Object> serialized, Class<T> clazz) {
    try {
      return SingletonHelper.OBJECT_MAPPER.treeToValue(
          SingletonHelper.TREE_MAPPER.valueToTree(
              deserializeCloudKnownTypes(serialized)),
          clazz);
    } catch (JsonProcessingException e) {
      throw new RuntimeException(
          "Unable to deserialize class " + clazz, e);
    }
  }

}