public void addMessage(PartitionId id, MessageInfo messageInfo, ByteBuffer buffer) {
    infosByPartition.computeIfAbsent(id, id1 -> new ArrayList<>()).add(messageInfo);
    buffersByPartition.computeIfAbsent(id, id1 -> new ArrayList<>()).add(buffer.duplicate());
  }
Adds a message to {@code id} with the provided details.
@param id the {@link PartitionId} to add the message to.
@param messageInfo the {@link MessageInfo} of the message.
@param buffer the data accompanying the message.
ambry-replication/src/test/java/com/github/ambry/replication/MockHost.java