code: public static Pattern concatenate(final Collection<?> requiredValues, final boolean caseInsensitive) {
          val pattern = requiredValues
              .stream()
              .map(Object::toString)
              .collect(Collectors.joining("|", "(", ")"));
          return createPattern(pattern, caseInsensitive ? Pattern.CASE_INSENSITIVE : 0);
      }
docs: Concatenate all elements in the given collection to form a regex pattern.
  
  @param requiredValues  the required values
  @param caseInsensitive the case insensitive
  @return the pattern