code: public void matches(Session other) throws ClientException {
  
          compareTransferParams(other);
          compareServerMode(other);
  
          if (needsGridFTP() && transferMode != MODE_EBLOCK) {
              throw new ClientException(ClientException.BAD_MODE,
                      "Extended block mode necessary");
          }
  
          if (other instanceof GridFTPSession &&
              ((GridFTPSession) other).needsGridFTP() &&
              transferMode != MODE_EBLOCK) {
              throw new ClientException(ClientException.BAD_MODE,
                      "Extended block mode necessary");
          }
      }
docs: In addition to the inherited functionality, this method also (1) checks
  if extended active / passive server modes are set correctly, (2) checks
  if Mode E is needed, and if so, checks whether it has been set. If not,
  ClientException is thrown.