private Map<byte[], SumResponse> sum(final Table table, final byte[] family,
    final byte[] qualifier, final byte[] start, final byte[] end)
    throws ServiceException, Throwable {
    ColumnAggregationProtos.SumRequest.Builder builder =
      ColumnAggregationProtos.SumRequest.newBuilder();
    builder.setFamily(ByteString.copyFrom(family));
    if (qualifier != null && qualifier.length > 0) {
      builder.setQualifier(ByteString.copyFrom(qualifier));
    }
    return table.batchCoprocessorService(
      ColumnAggregationProtos.ColumnAggregationService.getDescriptor().findMethodByName("sum"),
      builder.build(), start, end, ColumnAggregationProtos.SumResponse.getDefaultInstance());
  }
TestEndpoint: test cases to verify the batch execution of coprocessor Endpoint
hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestBatchCoprocessorEndpoint.java