static boolean hasPartitionsWithIsrGreaterThanReplicas(Cluster cluster) {
    for (String topic : cluster.topics()) {
      for (PartitionInfo partitionInfo : cluster.partitionsForTopic(topic)) {
        int numISR = partitionInfo.inSyncReplicas().length;
        if (numISR > partitionInfo.replicas().length) {
          return true;
        }
      }
    }
    return false;
  }
@Test
  public void testHasPartitionsWithIsrGreaterThanReplicas() {
    Cluster cluster = getCluster(Arrays.asList(new TopicPartition(TOPIC0, 0), new TopicPartition(TOPIC0, 1)));

    // Verify: No signal when the cluster has all replicas in sync.
    assertFalse(MonitorUtils.hasPartitionsWithIsrGreaterThanReplicas(cluster));

    // Verify: No signal when the cluster has an URP.
    Node[] singletonNode0 = {NODE_0};
    PartitionInfo urp = new PartitionInfo(TOPIC1, 0, NODE_0, nodes(), singletonNode0);
    cluster = cluster.withPartitions(Collections.singletonMap(new TopicPartition(TOPIC1, 0), urp));
    assertFalse(MonitorUtils.hasPartitionsWithIsrGreaterThanReplicas(cluster));

    // Verify: Expect signal when the cluster has partitions with ISR greater than replicas.
    PartitionInfo badPartition = new PartitionInfo(TOPIC1, 1, NODE_0, singletonNode0, nodes());
    cluster = cluster.withPartitions(Collections.singletonMap(new TopicPartition(TOPIC1, 1), badPartition));
    assertTrue(MonitorUtils.hasPartitionsWithIsrGreaterThanReplicas(cluster));
  }