public void getSuggestions(ArrayList<ISuggestionWrapper> suggestions) {
        ArrayList<SuggestionCacheWrapper<IDocument>> cachedSuggestions = queryPosition.getCachedSuggestions();
        for (SuggestionCacheWrapper<IDocument> suggestion : cachedSuggestions){
            double suggestionRank = suggestion.getRank() * EditOperation.getRankDiscount(previousEdits);
            boolean hasSuggestion = false;
            for(int i = 0; i < suggestions.size(); i++){
                ISuggestionWrapper suggestionWrapper = suggestions.get(i);
                if(suggestionWrapper.getSuggestion().equals(suggestion.getSuggestion().getLabel())){
                    if(suggestionWrapper.getRank() < suggestionRank){
                        suggestions.set(i, new SuggestionWrapper(suggestion.getSuggestion().getLabel(), suggestionRank));
                    }
                    hasSuggestion = true;
                    break;
                }
            }

            if(!hasSuggestion){
                suggestions.add(new SuggestionWrapper(suggestion.getSuggestion().getLabel(), suggestionRank));
            }
        }
    }