code: public static Batch[] all() throws AuthenticationException, InvalidRequestException, APIConnectionException,
  			APIException, UnsupportedEncodingException, MalformedURLException {
  		List<Batch> all_batches = new ArrayList<Batch>();
  		Map<String, String> params = new HashMap<String, String>();
  		while (true) {
  			Map<String, Object> reqParams = new HashMap<String, Object>(params);
  			BatchCollection coll = request(RequestMethod.GET, classURL(Batch.class), reqParams, BatchCollection.class,
  					null);
  			if (coll.array.length == 0) {
  				break;
  			}
  			all_batches.addAll(Arrays.asList(coll.array));
  			if (coll.next == null) {
  				break;
  			}
  			params = HttpUtil.queryToParams(new URL(coll.next).getQuery());
  		}
  		Batch[] array = new Batch[all_batches.size()];
  		all_batches.toArray(array);
  		return array;
  	}
docs: Get all batches created in the account.
  
  @return Array of Batch object