code: public static Collection<MatchedMethod> filterByClosestParams(
              final Collection<MatchedMethod> possibilities, final int paramsCount) {
          Collection<MatchedMethod> res = null;
          for (int i = 0; i < paramsCount; i++) {
              final Collection<MatchedMethod> filtered = filterByParam(possibilities, i);
              if (res != null) {
                  if (filtered.size() < res.size()) {
                      res = filtered;
                  }
              } else {
                  res = filtered;
              }
          }
          return res;
      }
docs: Looks for most specific type for each parameter.
  
  @param possibilities methods to reduce
  @param paramsCount   repository method params count
  @return possibly reduced collection or original one