@SuppressWarnings({"unchecked", "rawtypes"})
    public static <V> Function<VersionedRecord<byte[]>, VersionedRecord<V>> getDeserializeValue(final StateSerdes<?, V> serdes) {
        final Serde<V> valueSerde = serdes.valueSerde();
        final Deserializer<V> deserializer = valueSerde.deserializer();
        return rawVersionedRecord -> rawVersionedRecord.validTo().isPresent() ? new VersionedRecord<>(deserializer.deserialize(serdes.topic(), rawVersionedRecord.value()),
                                                                                                      rawVersionedRecord.timestamp(),
                                                                                                      rawVersionedRecord.validTo().get())
                                                                              : new VersionedRecord<>(deserializer.deserialize(serdes.topic(), rawVersionedRecord.value()),
                                                                                                      rawVersionedRecord.timestamp());
    }
a utility interface to facilitate stores' query dispatch logic,
allowing them to generically store query execution logic as the values
in a map.
streams/src/main/java/org/apache/kafka/streams/state/internals/StoreQueryUtils.java