You can save the total number of queries in a member variable:
int pendingRequests = 0; //... for(int i=0;i<size;i++) { requestQueue.add(request); pendingRequests++; }
Then, each time the request ends, you decrease the counter, and if it reaches 0, you know that all the requests are complete.
source share