public static <K, V> Branched<K, V> withConsumer(final Consumer<KStream<K, V>> chain) {
        Objects.requireNonNull(chain, "chain consumer cannot be null");
        return new Branched<>(null, null, chain);
    }
Create an instance of {@code Branched} with provided chain consumer.

@param chain
       A consumer to which the branch will be sent. If a consumer is provided,
       the respective branch will not be added to the resulting {@code Map} returned
       by {@link BranchedKStream#defaultBranch()} or {@link BranchedKStream#noDefaultBranch()} (see
       {@link BranchedKStream} description for details).

@param <K> key type
@param <V> value type

@return a new instance of {@code Branched}
streams/src/main/java/org/apache/kafka/streams/kstream/Branched.java