private static MultiResponse buildMultiResponse(MultiRequest req) {
    MultiResponse.Builder builder = MultiResponse.newBuilder();
    RegionActionResult.Builder regionActionResultBuilder = RegionActionResult.newBuilder();
    ResultOrException.Builder roeBuilder = ResultOrException.newBuilder();
    for (RegionAction regionAction : req.getRegionActionList()) {
      regionActionResultBuilder.clear();
      for (ClientProtos.Action action : regionAction.getActionList()) {
        roeBuilder.clear();
        roeBuilder.setResult(ClientProtos.Result.getDefaultInstance());
        roeBuilder.setIndex(action.getIndex());
        regionActionResultBuilder.addResultOrException(roeBuilder.build());
      }
      builder.addRegionActionResult(regionActionResultBuilder.build());
    }
    return builder.build();
  }
Call this restart method only after running MockMasterServices#start() The RSs can be
differentiated by the port number, see ServerName in MockMasterServices#start() method above.
Restart of region server will have new startcode in server name
@param serverName Server name to be restarted
hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/MockMasterServices.java