@Test public void testAddArticleVowel() throws Exception { assertThat(LanguageUtils.addArticle("attitude"), is("an attitude")); assertThat(LanguageUtils.addArticle("ear"), is("an ear")); assertThat(LanguageUtils.addArticle("igloo"), is("an igloo")); assertThat(LanguageUtils.addArticle("oar"), is("an oar")); }
public static String addArticle(String word) { if (word.isEmpty()) { return ""; } switch (word.charAt(0)) { case 'a': case 'e': case 'i': case 'o': return "an " + word; default: return "a " + word; } }
LanguageUtils { public static String addArticle(String word) { if (word.isEmpty()) { return ""; } switch (word.charAt(0)) { case 'a': case 'e': case 'i': case 'o': return "an " + word; default: return "a " + word; } } }
LanguageUtils { public static String addArticle(String word) { if (word.isEmpty()) { return ""; } switch (word.charAt(0)) { case 'a': case 'e': case 'i': case 'o': return "an " + word; default: return "a " + word; } } private  LanguageUtils(); }
LanguageUtils { public static String addArticle(String word) { if (word.isEmpty()) { return ""; } switch (word.charAt(0)) { case 'a': case 'e': case 'i': case 'o': return "an " + word; default: return "a " + word; } } private  LanguageUtils(); static String addArticle(String word); }
LanguageUtils { public static String addArticle(String word) { if (word.isEmpty()) { return ""; } switch (word.charAt(0)) { case 'a': case 'e': case 'i': case 'o': return "an " + word; default: return "a " + word; } } private  LanguageUtils(); static String addArticle(String word);  }