@Override
  public Optional<NearestKeyValue> getNearestBefore(
      final SegmentIdentifier segmentIdentifier, final Bytes key) throws StorageException {
    return getNearest(
        segmentIdentifier,
        e ->
            compareKeyLeftToRight(e.getKey(), key) <= 0
                && e.getKey().commonPrefixLength(key) >= e.getKey().size(),
        e -> compareKeyLeftToRight(e.getKey(), key) < 0,
        false);
  }
Instantiates a new In memory key value storage with specific set of segments.

@param segments the segments to be used
services/kvstore/src/main/java/org/hyperledger/besu/services/kvstore/SegmentedInMemoryKeyValueStorage.java