public static <InputT, OutputT> DoFnInvoker<InputT, OutputT> invokerFor(
      DoFn<InputT, OutputT> fn) {
    return ByteBuddyDoFnInvokerFactory.only().newByteBuddyInvoker(fn);
  }
@Test
  public void testDefaultGetSizeWithHasProgress() throws Exception {
    class MockFn extends DoFn<String, String> {
      @ProcessElement
      public void processElement(
          ProcessContext c,
          RestrictionTracker<RestrictionWithBoundedDefaultTracker, Void> tracker) {}

      @GetInitialRestriction
      public RestrictionWithBoundedDefaultTracker getInitialRestriction(@Element String element) {
        return null;
      }
    }

    abstract class HasProgressRestrictionTracker extends SomeRestrictionTracker
        implements HasProgress {}
    HasProgressRestrictionTracker tracker = mock(HasProgressRestrictionTracker.class);
    when(tracker.getProgress()).thenReturn(Progress.from(3.0, 4.0));

    when(mockArgumentProvider.restrictionTracker()).thenReturn((RestrictionTracker) tracker);

    MockFn fn = mock(MockFn.class);
    DoFnInvoker<String, String> invoker = DoFnInvokers.invokerFor(fn);
    assertEquals(4.0, invoker.invokeGetSize(mockArgumentProvider), 0.0001);
  }