class DotRegularExpression {

  public String[] evaluate(String[] words, String pattern) {
    if (words == null || pattern == null) {
      throw new IllegalArgumentException("You can't pass null objects as input.");
    }
    List<String> result = new ArrayList<String>();
    for (String word : words) {
      if (matchDotRegularExpression(word, pattern)) {
        result.add(word);
      }
    }
    return result.toArray(new String[result.size()]);
  }

}