Batch { public void merge(Batch<RequestT, ResponseT> batch) { requestBuilder.appendRequest(batch.getRequest()); requestIssuerList.addAll(batch.requestIssuerList); if (this.callable == null) { this.callable = batch.callable; } this.byteCount += batch.byteCount; } Batch(
      BatchingDescriptor<RequestT, ResponseT> descriptor,
      RequestT request,
      UnaryCallable<RequestT, ResponseT> callable,
      BatchedFuture<ResponseT> batchedFuture); RequestT getRequest(); UnaryCallable<RequestT, ResponseT> getCallable(); List<BatchedRequestIssuer<ResponseT>> getRequestIssuerList(); long getByteCount(); void merge(Batch<RequestT, ResponseT> batch);  }
@Test public void testMerge() { LabeledIntList request1 = new LabeledIntList("lable", 1); Batch<LabeledIntList, List<Integer>> batch1 = createBatch(request1); LabeledIntList request2 = new LabeledIntList("lable", 2); Batch<LabeledIntList, List<Integer>> batch2 = createBatch(request2); batch1.merge(batch2); Truth.assertThat(batch1.getByteCount()).isEqualTo(3); }