Description
Currently the Transformer interface's template is:
R transform(K key, V value);
While all its usage requires a key-value pair, and hence constructing the object as:
new Transformer<K, V, KeyValue<K1, V1>>
Since we expect Transformer to be only used in the Streams DSL, which is supposed to return another key-value pair streams, it's better to define its template just as
public interface Transformer<K, V, K1, V1> { KeyValue<K1, V1> transform(K key, V value); }
Also, we can allow punctuate() to also return a nullable KeyValue<K1, V1> pair, and let the implementation to forward to downstream processor only when the returned pair is not null.