code: public void setSentenceIterator(@NonNull SentenceIterator iterator) {
          //if (tokenizerFactory == null) throw new IllegalStateException("Please call setTokenizerFactory() prior to setSentenceIter() call.");
  
          if (tokenizerFactory != null) {
              SentenceTransformer transformer = new SentenceTransformer.Builder().iterator(iterator)
                              .tokenizerFactory(tokenizerFactory)
                              .allowMultithreading(configuration == null || configuration.isAllowParallelTokenization())
                              .build();
              this.iterator = new AbstractSequenceIterator.Builder<>(transformer).build();
          } else
              log.error("Please call setTokenizerFactory() prior to setSentenceIter() call.");
      }
docs: This method defines SentenceIterator instance, that will be used as training corpus source
  
  @param iterator SentenceIterator instance