@Test public void buildWithStrategy() { StrategyInfluencerChainBuilder chain = new StrategyInfluencerChainBuilder(); HttpExecutionStrategy transportStrategy = mock(HttpExecutionStrategy.class); when(transportStrategy.merge(defaultStrategy())).then(invocation -> invocation.getArgument(0)); HttpExecutionStrategy influenced = chain.build(transportStrategy).influenceStrategy(defaultStrategy()); assertThat("Unexpected infuenced strategy", influenced, sameInstance(defaultStrategy())); }
public HttpExecutionStrategyInfluencer build(HttpExecutionStrategy transportStrategy) { requireNonNull(transportStrategy); HttpExecutionStrategyInfluencer influencer = build0(); return strategy -> transportStrategy.merge(influencer.influenceStrategy(strategy)); }
StrategyInfluencerChainBuilder { public HttpExecutionStrategyInfluencer build(HttpExecutionStrategy transportStrategy) { requireNonNull(transportStrategy); HttpExecutionStrategyInfluencer influencer = build0(); return strategy -> transportStrategy.merge(influencer.influenceStrategy(strategy)); } }
StrategyInfluencerChainBuilder { public HttpExecutionStrategyInfluencer build(HttpExecutionStrategy transportStrategy) { requireNonNull(transportStrategy); HttpExecutionStrategyInfluencer influencer = build0(); return strategy -> transportStrategy.merge(influencer.influenceStrategy(strategy)); } StrategyInfluencerChainBuilder(); private  StrategyInfluencerChainBuilder(Deque<HttpExecutionStrategyInfluencer> influencers); }
StrategyInfluencerChainBuilder { public HttpExecutionStrategyInfluencer build(HttpExecutionStrategy transportStrategy) { requireNonNull(transportStrategy); HttpExecutionStrategyInfluencer influencer = build0(); return strategy -> transportStrategy.merge(influencer.influenceStrategy(strategy)); } StrategyInfluencerChainBuilder(); private  StrategyInfluencerChainBuilder(Deque<HttpExecutionStrategyInfluencer> influencers); void prepend(HttpExecutionStrategyInfluencer influencer); boolean prependIfInfluencer(Object mayBeInfluencer); void append(HttpExecutionStrategyInfluencer next); boolean appendIfInfluencer(Object mayBeInfluencer); StrategyInfluencerChainBuilder copy(); HttpExecutionStrategyInfluencer build(HttpExecutionStrategy transportStrategy); HttpExecutionStrategyInfluencer build(); }
StrategyInfluencerChainBuilder { public HttpExecutionStrategyInfluencer build(HttpExecutionStrategy transportStrategy) { requireNonNull(transportStrategy); HttpExecutionStrategyInfluencer influencer = build0(); return strategy -> transportStrategy.merge(influencer.influenceStrategy(strategy)); } StrategyInfluencerChainBuilder(); private  StrategyInfluencerChainBuilder(Deque<HttpExecutionStrategyInfluencer> influencers); void prepend(HttpExecutionStrategyInfluencer influencer); boolean prependIfInfluencer(Object mayBeInfluencer); void append(HttpExecutionStrategyInfluencer next); boolean appendIfInfluencer(Object mayBeInfluencer); StrategyInfluencerChainBuilder copy(); HttpExecutionStrategyInfluencer build(HttpExecutionStrategy transportStrategy); HttpExecutionStrategyInfluencer build();  }