code: protected void compareServerMode(Session other) throws ClientException {
  
          if (serverMode == SERVER_DEFAULT &&
              other.serverMode == SERVER_DEFAULT) {
              // this is OK
          } else {
              // active and passive side had already been set;
              // make sure that it has been done correctly:
              // either server can be active
              // providing that the other is passive
  
              // if this server mode has been defined,
              // but the other has not, we can't proceed
              if (this.serverMode == SERVER_DEFAULT ||
                  other.serverMode == SERVER_DEFAULT) {
                  throw new ClientException(ClientException.BAD_SERVER_MODE,
                          "Only one server has been defined as active or passive");
              }
  
              // both servers cannot have the same mode
              if (other.serverMode == this.serverMode) {
                  String modeStr = (this.serverMode == SERVER_PASSIVE) ? "passive"
                          : "active";
                  throw new ClientException(ClientException.BAD_SERVER_MODE,
                          "Both servers are " + modeStr);
              }
          }
      }
docs: checks that active / passive sides are correctly set