code: @SuppressWarnings("PMD.AvoidLiteralsInIfCondition")
      private static Method resolveMethod(final String name, final List<Class<?>> params,
                                          final List<MatchedMethod> possibilities) {
          MatchedMethod result;
          if (possibilities.size() == 1) {
              result = possibilities.get(0);
          } else {
              // using repository method name to reduce possibilities
              Collection<MatchedMethod> filtered = MethodFilters.filterByMethodName(possibilities, name);
              checkGuessSuccess(!filtered.isEmpty(), filtered);
              if (filtered.size() == 1) {
                  result = filtered.iterator().next();
              } else {
                  // extended method has higher priority
                  result = MethodFilters.findSingleExtended(filtered);
                  if (result == null) {
                      // try to filter using most closest parameters
                      filtered = MethodFilters.filterByClosestParams(filtered, params.size());
                      if (filtered.size() == 1) {
                          result = filtered.iterator().next();
                      } else {
                          result = MethodFilters.findSingleExtended(filtered);
                      }
                  }
                  checkGuessSuccess(result != null, filtered);
              }
          }
          return result == null ? null : result.method;
      }
docs: If more than one possibility found, filter methods using repository method name (if exact method name wasn't
  specified). If only one method has extended parameters it will be chosen, otherwise filtering
  possibilities by most specific type and look after that for single method with extended params.
  
  @param name          repository method name if exact method hint wasn't specified in annotation or null
  @param params        repository method parameters
  @param possibilities all found methods
  @return descriptor if guessing was successful
  @throws ru.vyarus.guice.persist.orient.repository.core.MethodDefinitionException if method guess fails