@Test public void effectPerformerInvokesConsumerAndPassesTheRequestedEffect() throws Exception { upstream.compose(Transformers.fromConsumer(consumer)).subscribe(); upstream.onNext("First Time"); assertThat(consumer.getCurrentValue(), is("First Time")); upstream.onNext("Do it again!"); assertThat(consumer.getCurrentValue(), is("Do it again!")); }
static <F, E> Transformer<F, E> fromConsumer(final Action1<F> doEffect) { return fromConsumer(doEffect, null); }
Transformers { static <F, E> Transformer<F, E> fromConsumer(final Action1<F> doEffect) { return fromConsumer(doEffect, null); } }
Transformers { static <F, E> Transformer<F, E> fromConsumer(final Action1<F> doEffect) { return fromConsumer(doEffect, null); } private  Transformers(); }
Transformers { static <F, E> Transformer<F, E> fromConsumer(final Action1<F> doEffect) { return fromConsumer(doEffect, null); } private  Transformers();  }
Transformers { static <F, E> Transformer<F, E> fromConsumer(final Action1<F> doEffect) { return fromConsumer(doEffect, null); } private  Transformers();   }