code: @Override
      protected final void checkIntegrity () throws InternetSCSIException {
  
          String exceptionMessage;
  
          do {
              final BasicHeaderSegment bhs = protocolDataUnit.getBasicHeaderSegment();
              if (bhs.isFinalFlag() && continueFlag) {
                  exceptionMessage = "Transit and Continue Flag cannot be set at the same time.";
                  break;
              }
  
              if (!bhs.isFinalFlag() && nextStageNumber != LoginStage.SECURITY_NEGOTIATION) {
                  exceptionMessage = "NextStageNumber is reserved, when the TransitFlag is not set.";
                  break;
              }
  
              if (bhs.isFinalFlag()) {
                  if (currentStageNumber == LoginStage.SECURITY_NEGOTIATION) {
                      if (nextStageNumber == LoginStage.SECURITY_NEGOTIATION) {
                          exceptionMessage = "This transition (SNP -> SNP) is not allowed.";
                          break;
                      }
                  } else if (currentStageNumber == LoginStage.LOGIN_OPERATIONAL_NEGOTIATION) {
                      if (nextStageNumber == LoginStage.SECURITY_NEGOTIATION) {
                          exceptionMessage = "This transition (LONP -> SNP) is not allowed.";
                          break;
                      } else if (nextStageNumber == LoginStage.LOGIN_OPERATIONAL_NEGOTIATION) {
                          exceptionMessage = "This transition (LONP -> LONP) is not allowed.";
                          break;
                      }
                  }
              }
  
              if (minVersion != 0x00) {
                  exceptionMessage = "MinVersion is not in a valid range.";
                  break;
              }
  
              if (maxVersion != 0x00) {
                  exceptionMessage = "MaxVersion is not in a valid range.";
                  break;
              }
  
              if (minVersion != maxVersion) {
                  exceptionMessage = "MinVersion and MaxVersion have not the same value.";
                  break;
              }
  
              // message is checked correctly
              return;
          } while (false);
  
          throw new InternetSCSIException(exceptionMessage);
      }
docs: {@inheritDoc}