Application { public int countWords(String words) { String[] separateWords = StringUtils.split(words, ' '); return (separateWords == null) ? 0 : separateWords.length; } Application(); int countWords(String words);  }
@Test public void testWordCountString() { int count = app.countWords("this is a test"); assertTrue(count == 4); }
@Test public void testWordCountEmpty() { int count = app.countWords(""); assertTrue(count == 0); }
@Test public void testWordCountNull() { int count = app.countWords(null); assertTrue(count == 0); }
@Test @Ignore public void testWordCountMore() { int count = app.countWords("this will be skipped"); assertTrue(count == 3); }
@Test public void testWordCountSingle() { int count = app.countWords("test"); assertTrue(count == 1); }