code: public void addPattern(Pattern pattern) {
          if (patterns == null) {
              patterns = new ArrayList<Pattern>();
          }
  
          patterns.add(pattern);
      }
docs: Add a pattern to the list of patterns.
  
  @param pattern a pattern