TupleStreamer implements AutoCloseable, Supplier<Stream<Tuple>> { public static TupleStreamer of(TupleStream tupleStream) { return new TupleStreamer(tupleStream); } private  TupleStreamer(TupleStream tupleStream); static TupleStreamer of(TupleStream tupleStream); @Override Stream<Tuple> get(); @Override void close();  }
@Test public void openIOExceptionIsWrapped() throws IOException { doThrow(new IOException()) .when(tupleStreamMock).open(); assertThatExceptionOfType(UncheckedIOException.class) .isThrownBy(() -> TupleStreamer.of(tupleStreamMock)); }