public Builder addWord(final String word, final DocRef source) {
            // Silently ignore blank/null words
            if (NullSafe.isNonBlankString(word)) {
                final String sourceUuid = Objects.requireNonNull(
                        source,
                        "Source DocRef required for word").getUuid();
                boolean doAdd = true;
                // Assumes that words are added in precedence order, i.e. most important source first
                if (deDup) {
                    if (wordSet.contains(word)) {
                        doAdd = false;
                    }
                }
                if (doAdd) {
                    wordList.add(new SourcedWord(word, sourceUuid));
//                    sourceList.add(sourceUuid);
                    wordSet.add(word);
                }

                // If not de-duping, then each word only has one source so we don't need this list
                final List<String> sourceUuids = wordToSourceUuidsMap.computeIfAbsent(
                        word, k -> new ArrayList<>());
                if (!sourceUuids.contains(sourceUuid)) {
                    sourceUuids.add(sourceUuid);
                }

                // Our reference lookup of uuid -> DocRef
                sourceUuidToDocRefMap.putIfAbsent(sourceUuid, source);
            }
            return this;
        }
@return The complete word list as a simple array or words.
stroom-core-shared/src/main/java/stroom/dictionary/shared/WordList.java