HaikuReview { public int countSyllables(String input) { int count = 0; Pattern pattern = Pattern.compile("[aeouiy]+"); Matcher matcher = pattern.matcher(input); while (matcher.find()) { count++; } return count; }  boolean validateLineCount(String input); int countWords(String input); String[] asLines(String input); int countSyllables(String input); boolean isHaiku(String input); String review(String input); static final int FIRST_LINE_SYLLABLE_COUNT; static final int SECOND_LINE_SYLLABLE_COUNT; static final int THIRD_LINE_SYLLABLE_COUNT; static final String RESULT_VALID; static final String RESULT_SEPARATOR; static final String RESULT_NO; }
@Test public void testNumberOfSyllablesIsOne() { int syllableCount = haikuReview.countSyllables("ups"); assertThat(syllableCount).isEqualTo(1); }
@Test public void testNumberOfSyllablesIsTwo() { int syllableCount = haikuReview.countSyllables("hello"); assertThat(syllableCount).isEqualTo(2); }
@Test public void testNumberOfSyllablesIsOneWithConsecutiveVowels() { int syllableCount = haikuReview.countSyllables("hey"); assertThat(syllableCount).isEqualTo(1); }
@Test public void testNumberOfSyllablesForThreeWords() { int syllableCount = haikuReview.countSyllables("happy purple bee"); assertThat(syllableCount).isEqualTo(5); }