BatcherImpl implements Batcher<ElementT, ElementResultT> { @Override public void flush() throws InterruptedException { sendOutstanding(); awaitAllOutstandingBatches(); } BatcherImpl(
      BatchingDescriptor<ElementT, ElementResultT, RequestT, ResponseT> batchingDescriptor,
      UnaryCallable<RequestT, ResponseT> unaryCallable,
      RequestT prototype,
      BatchingSettings batchingSettings,
      ScheduledExecutorService executor); @Override ApiFuture<ElementResultT> add(ElementT element); @Override void flush(); @Override void sendOutstanding(); @Override void close();  }
@Test public void testEmptyBatchesAreNeverSent() throws Exception { UnaryCallable<LabeledIntList, List<Integer>> callable = new UnaryCallable<LabeledIntList, List<Integer>>() { @Override public ApiFuture<List<Integer>> futureCall( LabeledIntList request, ApiCallContext context) { throw new AssertionError("Should not call"); } }; underTest = new BatcherImpl<>( SQUARER_BATCHING_DESC_V2, callable, labeledIntList, batchingSettings, EXECUTOR); underTest.flush(); }