@Override
    public Pair<byte[], byte[]> next() {
      var ourPeek = ourIterator.peek();
      var parentPeek = parentIterator.peek();

      if (ourPeek == null || parentPeek == null) {
        return ourPeek == null ? parentIterator.next() : mapEntryToPair(ourIterator.next());
      }

      // otherwise compare:
      int comparison = ourPeek.getKey().compareTo(Bytes.wrap(parentPeek.getKey()));
      if (comparison < 0) {
        return mapEntryToPair(ourIterator.next());
      } else if (comparison == 0) {
        // skip dupe key from parent, return ours:
        parentIterator.next();
        return mapEntryToPair(ourIterator.next());
      } else {
        return parentIterator.next();
      }
    }
Constructor which takes an explicit backing map for the layered key value storage.

@param map the backing map
@param parent the parent key value storage for this layered storage.
services/kvstore/src/main/java/org/hyperledger/besu/services/kvstore/LayeredKeyValueStorage.java