code: public void cancelAll(RequestFilter filter) {
          synchronized (currentRequests) {
              for (Request<?> request : currentRequests) {
                  if (filter.apply(request)) {
                      request.cancel();
                  }
              }
          }
      }
docs: Cancels all requests in this queue for which the given filter applies.
  
  @param filter The filtering function to use