docs: @SuppressWarnings("unchecked")
  	public void addWords(Object document, Collection<String> collection) {
  		if (document instanceof Collection<?>){
  			collection.addAll((Collection<String>)document);
  		}else if (document instanceof AnalyzedText){
  			collection.addAll(((AnalyzedText)document).getWords());
  		}else {
  			throw new IllegalArgumentException("Only instances of AnalyzedText can be handled.");
  		}
  	}