HaikuReview { public int getNumberOfSyllables(String line) { char[] chars = line.toCharArray(); char previousCharacter = ' '; int syllableCount = 0; for (int i = 0; i < chars.length; i++) { char currentCharacter = chars[i]; boolean previousCharacterIsAVowel = isAConstantant(previousCharacter); boolean endOfLine = i == chars.length - 1; if (previousCharacterIsAVowel && endOfLine) { syllableCount++; } else if (previousCharacterIsAVowel && !isAConstantant(currentCharacter)) { syllableCount++; } previousCharacter = currentCharacter; } return syllableCount; }  String[] splitHaiku(String haiku); boolean validateHaikuCharacters(String haiku); int getNumberOfSyllables(String line); boolean isAConstantant(char character);  }
@Test public void testWordIsOneSyllable() throws Exception { String oneSyllable = "ae"; int number = haikuReview.getNumberOfSyllables(oneSyllable); assertThat(number).isEqualTo(1); }
@Test public void test() { String string = "at"; int number = haikuReview.getNumberOfSyllables(string); assertThat(number).isEqualTo(1); }