@Test(expected = IllegalArgumentException.class) public void shouldNotAcceptNullArrayOrPatternAsInput() { dotRegularExpression.evaluate(null, null); }
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()]); }
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()]); } }
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()]); }  }
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()]); }  String[] evaluate(String[] words, String pattern); }
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()]); }  String[] evaluate(String[] words, String pattern);  }