public void getSuggestions(
            ArrayList<ISuggestionWrapper> suggestionsWrappers,
            int neededSuggestions,
            double rankThreshold)
    {
        int numberOfUsedSuggestions = 0;
        ArrayList<SuggestionCacheWrapper<IDocument>> suggestions = queryPosition.getCachedSuggestions();
        for (
                int i = nextSuggestion;
                i < Math.min(nextSuggestion + neededSuggestions, suggestions.size());
                i++)
        {
            SuggestionCacheWrapper<IDocument> suggestionDocument = suggestions.get(i);

            double suggestionRank = getDiscountRank(suggestionDocument);
            if(rankThreshold > suggestionRank){
                break;
            }

            boolean hasSuggestion = false;
            for(ISuggestionWrapper suggestionWrapper : suggestionsWrappers){
                if(suggestionWrapper.getSuggestion().equals(suggestionDocument.getSuggestion().getLabel())){
                    hasSuggestion = true;
                    break;
                }
            }

            if(!hasSuggestion){
                suggestionsWrappers.add(new SuggestionWrapper(suggestionDocument.getSuggestion().getLabel(), suggestionRank));
                numberOfUsedSuggestions++;
            }
            else{
                nextSuggestion++;
            }
        }

        nextSuggestion += numberOfUsedSuggestions;
        //System.out.println("Got these: " + suggestionsWrappers);
    }