text: public void build(InputIterator iterator) throws IOException {if (iterator.hasPayloads()) {throw new IllegalArgumentException("this suggester doesn't support payloads");}if (iterator.hasContexts()) {throw new IllegalArgumentException("this suggester doesn't support contexts");}root = new TernaryTreeNode();iterator = new SortedInputIterator(tempDir, tempFileNamePrefix, iterator, utf8SortedAsUTF16SortOrder);count = 0;ArrayList<String> tokens = new ArrayList<>();ArrayList<Number> vals = new ArrayList<>();BytesRef spare;CharsRefBuilder charsSpare = new CharsRefBuilder();while ((spare = iterator.next()) != null) {charsSpare.copyUTF8Bytes(spare);tokens.add(charsSpare.toString());vals.add(Long.valueOf(iterator.weight()));count++;}autocomplete.balancedTree(tokens.toArray(), vals.toArray(), 0, tokens.size() - 1, root);}