code: public Query<S> query(Filter<S> filter, OrderingList<S> ordering, QueryHints hints)
          throws FetchException
      {
          filter = filter.bind();
  
          Map<OrderingList<S>, Query<S>> map;
          synchronized (mFilterToQuery) {
              map = mFilterToQuery.get(filter);
              if (map == null) {
                  if (filter == null) {
                      throw new IllegalArgumentException("Query filter must not be null");
                  }
                  map = new SoftValuedHashMap(7);
                  mFilterToQuery.put(filter, map);
              }
          }
  
          Query<S> query;
          synchronized (map) {
              query = map.get(ordering);
              if (query == null) {
                  FilterValues<S> values = filter.initialFilterValues();
                  if (values == null && filter.isClosed()) {
                      query = new EmptyQuery<S>(this, ordering);
                  } else {
                      StandardQuery<S> standardQuery = createQuery(filter, values, ordering, hints);
                      if (!mLazySetExecutor) {
                          try {
                              standardQuery.setExecutor();
                          } catch (RepositoryException e) {
                              throw e.toFetchException();
                          }
                      }
                      query = standardQuery;
                  }
                  map.put(ordering, query);
              }
          }
  
          return query;
      }
docs: Returns a new or cached query for the given query specification.
  
  @throws IllegalArgumentException if filter is null