void assertAllRegionServers(String tableName) throws InterruptedException {
    Map<ServerName, ServerMetrics> servers;
    boolean success = false;
    String[] expectedCoprocessors = regionServerSystemCoprocessors;
    if (tableName == null) {
      // if no tableName specified, use all servers.
      servers = TEST_UTIL.getMiniHBaseCluster().getMaster().getServerManager().getOnlineServers();
    } else {
      servers = serversForTable(tableName);
    }
    for (int i = 0; i < 5; i++) {
      boolean any_failed = false;
      for (Map.Entry<ServerName, ServerMetrics> server : servers.entrySet()) {
        String[] actualCoprocessors =
          server.getValue().getCoprocessorNames().stream().toArray(size -> new String[size]);
        if (!Arrays.equals(actualCoprocessors, expectedCoprocessors)) {
          LOG.debug("failed comparison: actual: " + Arrays.toString(actualCoprocessors)
            + " ; expected: " + Arrays.toString(expectedCoprocessors));
          any_failed = true;
          expectedCoprocessors = switchExpectedCoprocessors(expectedCoprocessors);
          break;
        }
        expectedCoprocessors = switchExpectedCoprocessors(expectedCoprocessors);
      }
      if (any_failed == false) {
        success = true;
        break;
      }
      LOG.debug("retrying after failed comparison: " + i);
      Thread.sleep(1000);
    }
    assertTrue(success);
  }
return the subset of all regionservers (actually returns set of ServerLoads) which host some
region in a given table. used by assertAllRegionServers() below to test reporting of loaded
coprocessors.
@param tableName : given table.
@return subset of all servers.
hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestClassLoading.java