private AbstractRpcBasedConnectionRegistry createRegistry(int hedged) throws IOException {
    Configuration conf = UTIL.getConfiguration();
    conf.setInt(HEDGED_REQS_FANOUT_CONFIG_NAME, hedged);
    return new AbstractRpcBasedConnectionRegistry(conf, User.getCurrent(),
      HEDGED_REQS_FANOUT_CONFIG_NAME, INITIAL_DELAY_SECS_CONFIG_NAME,
      REFRESH_INTERVAL_SECS_CONFIG_NAME, MIN_REFRESH_INTERVAL_SECS_CONFIG_NAME) {

      @Override
      protected Set<ServerName> getBootstrapNodes(Configuration conf) throws IOException {
        return BOOTSTRAP_NODES;
      }

      @Override
      protected CompletableFuture<Set<ServerName>> fetchEndpoints() {
        return CompletableFuture.completedFuture(BOOTSTRAP_NODES);
      }

      @Override
      public String getConnectionString() {
        return "unimplemented";
      }
    };
  }
A dummy RpcChannel implementation that intercepts the GetClusterId() RPC calls and injects
errors. All other RPCs are ignored.
hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestRpcBasedRegistryHedgedReads.java