code: private synchronized void incrementTransactionID() {
          if (isCheckingValidity()) {
              if (transactionID >= Modbus.MAX_TRANSACTION_ID) {
                  transactionID = Modbus.DEFAULT_TRANSACTION_ID;
              }
              else {
                  transactionID++;
              }
          }
          request.setTransactionID(getTransactionID());
      }
docs: incrementTransactionID -- Increment the transaction ID for the next
  transaction. Note that the caller must get the new transaction ID with
  getTransactionID(). This is only done validity checking is enabled so
  that dumb slaves don't cause problems. The original request will have its
  transaction ID incremented as well so that sending the same transaction
  again won't cause problems.