private void comparePartitions(List<PartitionId> staticPartitionIds, List<PartitionId> helixPartitionIds,
      String partitionStateStr) {
    Set<String> staticWritablePartitionSet = new HashSet<>();
    Set<String> helixWritablePartitionSet = new HashSet<>();
    staticPartitionIds.forEach(p -> staticWritablePartitionSet.add(p.toString()));
    helixPartitionIds.forEach(p -> helixWritablePartitionSet.add(p.toString()));
    if (!staticWritablePartitionSet.equals(helixWritablePartitionSet)) {
      helixClusterManagerMetrics.getWritablePartitionIdsMismatchCount.inc();
      Set<String> partitionsInBoth = new HashSet<>(staticWritablePartitionSet);
      partitionsInBoth.retainAll(helixWritablePartitionSet);
      staticWritablePartitionSet.removeAll(partitionsInBoth);
      helixWritablePartitionSet.removeAll(partitionsInBoth);
      staticWritablePartitionSet.forEach(
          partition -> logger.debug("{} is {} partition in static clustermap only", partition, partitionStateStr));
      helixWritablePartitionSet.forEach(
          partition -> logger.debug("{} is {} partition in helix only", partition, partitionStateStr));
    }
  }
Compare the partition ids from both the underlying {@link StaticClusterManager} and the underlying
{@link HelixClusterManager}.If there is a mismatch, update a metric.
@param staticPartitionIds {@link List} of {@link PartitionId}s from {@link StaticClusterManager}.
@param helixPartitionIds {@link List} of {@link PartitionId}s from {@link HelixClusterManager}.
@param partitionStateStr String representing the state of the partitionids for logging.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/CompositeClusterManager.java