BoundedReadFromUnboundedSource extends PTransform<PBegin, PCollection<T>> { public BoundedReadFromUnboundedSource<T> withMaxNumRecords(long maxNumRecords) { return new BoundedReadFromUnboundedSource<>(source, maxNumRecords, maxReadTime); } BoundedReadFromUnboundedSource(
      UnboundedSource<T, ?> source, long maxNumRecords, @Nullable Duration maxReadTime); BoundedReadFromUnboundedSource<T> withMaxNumRecords(long maxNumRecords); BoundedReadFromUnboundedSource<T> withMaxReadTime(Duration maxReadTime); @Override PCollection<T> expand(PBegin input); @Override String getKindString(); @Override void populateDisplayData(DisplayData.Builder builder);  }
@Test public void testForwardsDisplayData() { TestCountingSource src = new TestCountingSource(1234) { @Override public void populateDisplayData(DisplayData.Builder builder) { builder.add(DisplayData.item("foo", "bar")); } }; BoundedReadFromUnboundedSource<KV<Integer, Integer>> read = Read.from(src).withMaxNumRecords(5); assertThat(DisplayData.from(read), includesDisplayDataFor("source", src)); }