private static List<String> loadAddresses(
      OptionSet options, OptionSpec<String> spec, AddressLevel addressLevel) {
    String addresses = options.valueOf(spec);
    if (addresses == null) {
      return null;
    }

    List<String> result = new LinkedList<String>();
    for (String addressString : addresses.split(",")) {

      if (addressString != null) {
        SimulatorAddress address;
        try {
          address = SimulatorAddress.fromString(addressString);
        } catch (Exception e) {
          throw new CommandLineExitException(
              "Worker address [" + addressString + "] is not a valid simulator address", e);
        }

        if (!address.getAddressLevel().equals(addressLevel)) {
          throw new CommandLineExitException(
              "address ["
                  + addressString
                  + "] is not a valid "
                  + addressLevel
                  + " address, it's a "
                  + address.getAddressLevel()
                  + " address");
        }
      }
      result.add(addressString);
    }

    return result;
  }
  AbstractServerConfiguration(
      OperationProcessor processor,
      ConcurrentMap<String, ResponseFuture> futureMap,
      SimulatorAddress localAddress,
      int port) {
    this.processor = processor;
    this.futureMap = futureMap;

    this.localAddress = localAddress;
    this.addressIndex = localAddress.getAddressIndex();

    this.port = port;
  }
  AbstractClientConfiguration(
      ConcurrentMap<String, ResponseFuture> futureMap,
      SimulatorAddress localAddress,
      int remoteIndex,
      String remoteHost,
      int remotePort) {
    this.futureMap = futureMap;

    this.localAddress = localAddress;
    this.remoteAddress = localAddress.getChild(remoteIndex);

    this.remoteIndex = remoteIndex;
    this.remoteHost = remoteHost;
    this.remotePort = remotePort;
  }
 public FailureOperation(
     String message,
     FailureType type,
     SimulatorAddress workerAddress,
     String agentAddress,
     String hzAddress,
     String workerId,
     String testId,
     TestSuite testSuite,
     String cause) {
   this.message = message;
   this.type = type.name();
   this.workerAddress = (workerAddress == null) ? null : workerAddress.toString();
   this.agentAddress = agentAddress;
   this.hzAddress = hzAddress;
   this.workerId = workerId;
   this.testId = testId;
   this.testSuite = testSuite;
   this.cause = cause;
 }
 public SimulatorAddress getWorkerAddress() {
   return SimulatorAddress.fromString(workerAddress);
 }