public SimpleIndex build() {
            LongObjectHashMap<Entry> dictionary = new LongObjectHashMap<>();
            for (Map.Entry<Long, List<Posting>> entry : dictionaryBuilder.entrySet()) {
                List<Posting> postings = entry.getValue();
                Collections.sort(postings);
                int size = postings.size();
                int[] docIds = new int[size];
                int[] dataRefs = new int[size];
                for (int i = 0; i < size; i++) {
                    Posting posting = postings.get(i);
                    docIds[i] = posting.getId();
                    dataRefs[i] = posting.getDataRef();
                }
                dictionary.put(entry.getKey(), new Entry(docIds, dataRefs));
            }
            dictionary.compact();
            return new SimpleIndex(dictionary);
        }
Inserts an object with an id for a key.
@param key Key to map from
@param posting Entry for the posting list
predicate-search/src/main/java/com/yahoo/search/predicate/index/SimpleIndex.java