@Test public void testSupplierError() { StreamTransducer<Integer, Integer> transducer = StreamTransducer.create(new TransducerPipe<>()); ExpectedException exception = new ExpectedException("Test Exception"); StreamSupplier<Integer> supplier = concat( StreamSupplier.of(1, 2, 3), StreamSupplier.of(4, 5, 6), StreamSupplier.closingWithError(exception)); StreamConsumerToList<Integer> consumer = StreamConsumerToList.create(); Throwable e = awaitException(supplier.transformWith(transducer) .streamTo(consumer)); assertSame(exception, e); assertEquals(asList(1, 2, 3, 4, 5, 6), consumer.getList()); assertClosedWithError(consumer); assertClosedWithError(transducer); }
public static <I, O> StreamTransducer<I, O> create(Transducer<I, O, ?> transducer) { return new StreamTransducer<>(transducer); }
StreamTransducer implements StreamTransformer<I, O> { public static <I, O> StreamTransducer<I, O> create(Transducer<I, O, ?> transducer) { return new StreamTransducer<>(transducer); } }
StreamTransducer implements StreamTransformer<I, O> { public static <I, O> StreamTransducer<I, O> create(Transducer<I, O, ?> transducer) { return new StreamTransducer<>(transducer); } private  StreamTransducer(Transducer<I, O, ?> transducer); }
StreamTransducer implements StreamTransformer<I, O> { public static <I, O> StreamTransducer<I, O> create(Transducer<I, O, ?> transducer) { return new StreamTransducer<>(transducer); } private  StreamTransducer(Transducer<I, O, ?> transducer); static StreamTransducer<I, O> create(Transducer<I, O, ?> transducer); @Override StreamConsumer<I> getInput(); @Override StreamSupplier<O> getOutput(); }
StreamTransducer implements StreamTransformer<I, O> { public static <I, O> StreamTransducer<I, O> create(Transducer<I, O, ?> transducer) { return new StreamTransducer<>(transducer); } private  StreamTransducer(Transducer<I, O, ?> transducer); static StreamTransducer<I, O> create(Transducer<I, O, ?> transducer); @Override StreamConsumer<I> getInput(); @Override StreamSupplier<O> getOutput();  }