code: public static <T> SerializedCheckpointData[] fromDeque(
  			ArrayDeque<Tuple2<Long, Set<T>>> checkpoints,
  			TypeSerializer<T> serializer,
  			DataOutputSerializer outputBuffer) throws IOException {
  
  		SerializedCheckpointData[] serializedCheckpoints = new SerializedCheckpointData[checkpoints.size()];
  
  		int pos = 0;
  		for (Tuple2<Long, Set<T>> checkpoint : checkpoints) {
  			outputBuffer.clear();
  			Set<T> checkpointIds = checkpoint.f1;
  
  			for (T id : checkpointIds) {
  				serializer.serialize(id, outputBuffer);
  			}
  
  			serializedCheckpoints[pos++] = new SerializedCheckpointData(
  					checkpoint.f0, outputBuffer.getCopyOfBuffer(), checkpointIds.size());
  		}
  
  		return serializedCheckpoints;
  	}
docs: Converts a list of checkpoints into an array of SerializedCheckpointData.
  
  @param checkpoints The checkpoints to be converted into IdsCheckpointData.
  @param serializer The serializer to serialize the IDs.
  @param outputBuffer The reusable serialization buffer.
  @param <T> The type of the ID.
  @return An array of serializable SerializedCheckpointData, one per entry in the queue.
  
  @throws IOException Thrown, if the serialization fails.