private void checkStoreKeyDuplicates(List<? extends StoreKey> keys) throws IllegalArgumentException {
    if (keys.size() > 1) {
      Set<StoreKey> seenKeys = new HashSet<>();
      Set<StoreKey> duplicates = keys.stream().filter(key -> !seenKeys.add(key)).collect(Collectors.toSet());
      if (duplicates.size() > 0) {
        throw new IllegalArgumentException("list contains duplicates. Duplicates detected: " + duplicates);
      }
    }
  }
Detects duplicates in {@code keys}
@param keys list of {@link StoreKey} to detect duplicates in
@throws IllegalArgumentException if a duplicate is detected
ambry-cloud/src/main/java/com/github/ambry/cloud/CloudBlobStore.java