private List<String> setReplace(List<String> replaceList,int index,String invertedWord) {
        if (replaceList==null)
            replaceList=new ArrayList<>();
        while (replaceList.size()<index)
            replaceList.add(null);
        replaceList.add(invertedWord);
        return replaceList;
    }
Adds a replace word at an index, and any required null's to get to this item. Creates the list if it is null
container-search/src/main/java/com/yahoo/prelude/querytransform/PhraseMatcher.java