@Test public void shouldNotifyBothPassedConsumers() { final AtomicInteger first = new AtomicInteger(); final AtomicInteger second = new AtomicInteger(); final PerformanceConsumer pc = TeePerformanceConsumer.createFrom( new PerformanceConsumer() { @Override public void consume(final String message, final LoopPerformances loopPerformances) { first.set(Integer.valueOf(message)); } }, new PerformanceConsumer() { @Override public void consume(final String message, final LoopPerformances loopPerformances) { second.set(Integer.valueOf(message)); } }); pc.consume("1234", null); assertEquals(1234, first.get()); assertEquals(1234, second.get()); }
public static TeePerformanceConsumer createFrom( final PerformanceConsumer... consumers) { return new TeePerformanceConsumer(consumers); }
TeePerformanceConsumer extends AbstractPerformanceProducer<TeePerformanceConsumer> { public static TeePerformanceConsumer createFrom( final PerformanceConsumer... consumers) { return new TeePerformanceConsumer(consumers); } }
TeePerformanceConsumer extends AbstractPerformanceProducer<TeePerformanceConsumer> { public static TeePerformanceConsumer createFrom( final PerformanceConsumer... consumers) { return new TeePerformanceConsumer(consumers); } TeePerformanceConsumer(final PerformanceConsumer... consumers); }
TeePerformanceConsumer extends AbstractPerformanceProducer<TeePerformanceConsumer> { public static TeePerformanceConsumer createFrom( final PerformanceConsumer... consumers) { return new TeePerformanceConsumer(consumers); } TeePerformanceConsumer(final PerformanceConsumer... consumers); static TeePerformanceConsumer createFrom(
            final PerformanceConsumer... consumers); }
TeePerformanceConsumer extends AbstractPerformanceProducer<TeePerformanceConsumer> { public static TeePerformanceConsumer createFrom( final PerformanceConsumer... consumers) { return new TeePerformanceConsumer(consumers); } TeePerformanceConsumer(final PerformanceConsumer... consumers); static TeePerformanceConsumer createFrom(
            final PerformanceConsumer... consumers);  }