WordCountValidator { public boolean validate(String input) { StringTokenizer tokenizer = new StringTokenizer(input, " /", false); return tokenizer.countTokens() >= MIN_WORDS; }  boolean validate(String input);  }
@Test public void testInputWithTwoWordsIsNotValid() throws Exception { String input = "paul boolean result = validator.validate(input); assertFalse(result); }
@Test public void testInputWithAtLeastThreeWordsIsValid() throws Exception { String input = "paul / smells/ badly !!!"; boolean result = validator.validate(input); assertTrue(result); }