code: private <R extends J4pResponse<T>, T extends J4pRequest> List<R> extractResponses(JSONAware pJsonResponse,
                                                                                        List<T> pRequests,
                                                                                        J4pResponseExtractor pResponseExtractor) throws J4pException {
          JSONArray responseArray = (JSONArray) pJsonResponse;
          List<R> ret = new ArrayList<R>(responseArray.size());
          J4pRemoteException remoteExceptions[] = new J4pRemoteException[responseArray.size()];
          boolean exceptionFound = false;
          for (int i = 0; i < pRequests.size(); i++) {
              T request = pRequests.get(i);
              Object jsonResp = responseArray.get(i);
              if (!(jsonResp instanceof JSONObject)) {
                  throw new J4pException("Response for request Nr. " + i + " is invalid (expected a map but got " + jsonResp.getClass() + ")");
              }
              try {
                  ret.add(i,pResponseExtractor.<R,T>extract(request, (JSONObject) jsonResp));
              } catch (J4pRemoteException exp) {
                  remoteExceptions[i] = exp;
                  exceptionFound = true;
                  ret.add(i,null);
              }
          }
          if (exceptionFound) {
              List partialResults = new ArrayList();
              // Merge partial results and exceptions in a single list
              for (int i = 0;i<pRequests.size();i++) {
                  J4pRemoteException exp = remoteExceptions[i];
                  if (exp != null) {
                      partialResults.add(exp);
                  } else {
                      partialResults.add(ret.get(i));
                  }
              }
              throw new J4pBulkRemoteException(partialResults);
          }
          return ret;
      }
docs: Extract J4pResponses from a returned bulk JSON answer