public static Set<String> toStringSet(TemplateCollectionModel collModel) throws TemplateModelException {
  Set<String> set=new HashSet<String>();
  TemplateModelIterator modelIt=collModel.iterator();
  while (modelIt.hasNext()) {
    set.add(getAsStringNonEscaping((TemplateScalarModel)modelIt.next()));
  }
  return set;
}

public static Set < String > toStringSet ( TemplateCollectionModel collModel ) throws TemplateModelException { Set < String > set = new HashSet < String > ( ) ; TemplateModelIterator modelIt = collModel . iterator ( ) ; while ( modelIt . hasNext ( ) ) { set . add ( getAsStringNonEscaping ( ( TemplateScalarModel ) modelIt . next ( ) ) ) ; } return set ; }
to string set . < p > warn : bypasses auto - escaping , caller handles . ( e . g . the object wrapper used to rewrap the result ) .
