static void setServerErrorCodes(List<ServerErrorCode> serverErrorCodesInOrder, MockServerLayout serverLayout) {
    Collection<MockServer> servers = serverLayout.getMockServers();
    if (serverErrorCodesInOrder.size() > servers.size()) {
      throw new IllegalArgumentException("More server error codes provided than servers in cluster");
    }
    int i = 0;
    for (MockServer server : servers) {
      if (i < serverErrorCodesInOrder.size()) {
        server.setServerErrorForAllRequests(serverErrorCodesInOrder.get(i++));
      } else {
        server.setServerErrorForAllRequests(ServerErrorCode.NoError);
      }
    }
  }
Set the servers in the specified layout to respond with the designated error codes.
@param serverErrorCodesInOrder The error codes to set in the order of the servers in {@code serverLayout}.
                               If there are fewer error codes in this array than there are servers,
                               the rest of the servers are set to {@link ServerErrorCode#NoError}
@param serverLayout A {@link MockServerLayout} that is used to find the {@link MockServer}s to set error codes on.
@throws IllegalArgumentException If there are more error codes in the input array then there are servers.
ambry-router/src/test/java/com/github/ambry/router/RouterTestHelpers.java