class DefaultExactMatchPolicy extends AbstractPolicy implements ExactMatchPolicy {

    @Override
    public Search findExactMatch(SearchResult searchResult)
    {
        if(this.isExactMatchForSingleSuccess() && searchResult.successCount() == 1)
        {
            List<Search> searches = searchResult.getSearches();
            for (Search search : searches)
            {
                if(!search.isRejected())
                {
                    return search;
                }
            }
        }
        List<Search> searches = searchResult.successfulSearchesEqualOrLessThan(exactMatchMaxLevel);
        if(!searches.isEmpty())
        {
            // Choose the first one
            return searches.get(0);
        }
        return null;
    }

}