/**
* Returns the user specify batch size or {@code null} if not specified.
*/
private Integer getBatchSize(Method method) {
// Determine queue batch size, if any
Batch batch = method.getAnnotation(Batch.class);
if (batch != null) {
int batchSize = batch.value();
Preconditions.checkArgument(batchSize > 0, "Batch size should be > 0: %s", method.getName());
return batchSize;
}
return null;
}