HaikuReview { public String review(String input) { if (isHaiku(input)) { return RESULT_VALID; } String[] lines = asLines(input); String lineOne = formattedSyllableCount(lines[0]); String lineTwo = formattedSyllableCount(lines[1]); String lineThree = formattedSyllableCount(lines[2]); return lineOne + lineTwo + lineThree + RESULT_NO; }  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 testOutputForValidHaikuHasYes() throws Exception { String output = haikuReview.review(VALID_INPUT_ONE); assertThat(output).contains("Yes"); }
@Test public void testOutputForInvalidHaikuHasNo() throws Exception { String output = haikuReview.review(INVALID_FIRST_LINE); assertThat(output).contains("No"); }
@Test public void testOutputSyllableCountForValidHaikuIs575Yes() throws Exception { String output = haikuReview.review(VALID_INPUT_ONE); assertThat(output).isEqualTo("5,7,5,Yes"); }
@Test public void testOutputSyllableCountForInvalidHaikuIsCorrect() throws Exception { String output = haikuReview.review(INVALID_COUNT_474); assertThat(output).isEqualTo("4,7,4,No"); }
@Test public void testOutputSyllableCountForAnotherInvalidHaikuIsCorrect() throws Exception { String output = haikuReview.review(INVALID_COUNT_373); assertThat(output).isEqualTo("3,7,3,No"); }