private static BigInteger difficulty(final Quantity value) {
    return value.getAsBigInteger();
  }
Provides the various difficultly calculates used on mainnet hard forks.
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetDifficultyCalculators.java