@Test public void ofSupplier() throws Exception { when(supplier.get()).thenReturn(10); SegmentReader<Integer> reader = SegmentReader.ofSupplier(supplier); verifyZeroInteractions(supplier); assertEquals(new Integer(10), reader.decode()); verify(supplier, times(1)).get(); verifyNoMoreInteractions(supplier); }
@Override public U decode() throws IOException, OncRpcException { return fn.apply(in.decode()); }
MappedSegmentReader implements SegmentReader<U> { @Override public U decode() throws IOException, OncRpcException { return fn.apply(in.decode()); } }
MappedSegmentReader implements SegmentReader<U> { @Override public U decode() throws IOException, OncRpcException { return fn.apply(in.decode()); }  }
MappedSegmentReader implements SegmentReader<U> { @Override public U decode() throws IOException, OncRpcException { return fn.apply(in.decode()); }  @Override U decode(); }
MappedSegmentReader implements SegmentReader<U> { @Override public U decode() throws IOException, OncRpcException { return fn.apply(in.decode()); }  @Override U decode();  }