@Override
  public KeyValueSnapshot<K, V> snapshot(K from, K to) {
    final ConcurrentNavigableMap<byte[], byte[]> values = map.subMap(keySerde.toBytes(from), keySerde.toBytes(to));
    return new KeyValueSnapshot<K, V>() {
      @Override
      public KeyValueIterator<K, V> iterator() {
        return new InMemoryIterator<>(values.entrySet().iterator(), keySerde, valSerde);
      }

      @Override
      public void close() {
      }
    };
  }
An in-memory store that supports range queries.

@param <K> the type of keys in the store
@param <V> the type of values in the store
samza-core/src/test/java/org/apache/samza/operators/impl/store/TestInMemoryStore.java