code: public FulltextMatch setPatterns(
                      final Collection<String> patterns
                      )
      {
          if (patterns == null  ||  patterns.size() == 0) {
              clearPatterns();
              return this;
          }
  
          synchronized (patterns) {
              for (String  pattern : patterns) {
                  if (pattern == null  ||  pattern.length() == 0) {
                      throw new IllegalArgumentException( "null element" );
                  }
              }
  
              clearPatterns();
              for (String  pattern : patterns) {
                  addPattern( pattern );
              }
          }
  
          return this;
      }
docs: Sets the matching patterns.
  
  @param   patterns
  the matching patterns