public void updateBaseFee(final Wei newBaseFee) {
    LOG.atTrace()
        .setMessage("Updating base fee from {} to {}")
        .addArgument(this.baseFee)
        .addArgument(newBaseFee::toShortHexString)
        .log();
    if (this.baseFee.orElse(Wei.ZERO).equals(newBaseFee)) {
      return;
    }
    synchronized (lock) {
      final boolean baseFeeIncreased = newBaseFee.compareTo(this.baseFee.orElse(Wei.ZERO)) > 0;
      this.baseFee = Optional.of(newBaseFee);
      if (baseFeeIncreased) {
        // base fee increases can only cause transactions to go from static to dynamic range
        prioritizedTransactionsStaticRange.stream()
            .filter(
                // these are the transactions whose effective priority fee have now dropped
                // below their max priority fee
                pendingTx -> !isInStaticRange(pendingTx.getTransaction(), baseFee))
            .collect(toUnmodifiableList())
            .forEach(
                pendingTx -> {
                  LOG.atTrace()
                      .setMessage("Moving {} from static to dynamic gas fee paradigm")
                      .addArgument(pendingTx::toTraceLog)
                      .log();
                  prioritizedTransactionsStaticRange.remove(pendingTx);
                  prioritizedTransactionsDynamicRange.add(pendingTx);
                });
      } else {
        // base fee decreases can only cause transactions to go from dynamic to static range
        prioritizedTransactionsDynamicRange.stream()
            .filter(
                // these are the transactions whose effective priority fee are now above their
                // max priority fee
                pendingTx -> isInStaticRange(pendingTx.getTransaction(), baseFee))
            .collect(toUnmodifiableList())
            .forEach(
                pendingTx -> {
                  LOG.atTrace()
                      .setMessage("Moving {} from dynamic to static gas fee paradigm")
                      .addArgument(pendingTx::toTraceLog)
                      .log();
                  prioritizedTransactionsDynamicRange.remove(pendingTx);
                  prioritizedTransactionsStaticRange.add(pendingTx);
                });
      }
    }
  }
See this post for an explainer about these data structures:
https://hackmd.io/@adietrichs/1559-transaction-sorting
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/BaseFeePendingTransactionsSorter.java