private void checkDuplicates(List<MessageInfo> infos) {
    if (infos.size() > 1) {
      Set<StoreKey> seenKeys = new HashSet<>();
      for (MessageInfo info : infos) {
        if (!seenKeys.add(info.getStoreKey())) {
          metrics.duplicateKeysInBatch.inc();
          throw new IllegalArgumentException("WriteSet contains duplicates. Duplicate detected: " + info.getStoreKey());
        }
      }
    }
  }
Detects duplicates in {@code writeSet}
@param infos the list of {@link MessageInfo} to detect duplicates in
ambry-store/src/main/java/com/github/ambry/store/BlobStore.java