code: public static Pattern selection(Pattern pattern1, Pattern pattern2)
     {
        if (pattern1 == null || pattern2 == null)
        {
           throw new IllegalArgumentException("Neither pattern can be null");
        }
        return new SelectPattern(pattern1, pattern2);
     }
docs: A pattern which matches <code>pattern1</code> followed by <code>pattern2</code> and
  returns the longer of the two matches.
  @param pattern1
  @param pattern2
  @return
  @throws IllegalArgumentException if either argument is <code>null</code>