@Test public void testAddArticleConsonant() throws Exception { assertThat(LanguageUtils.addArticle("tower"), is("a tower")); assertThat(LanguageUtils.addArticle("sibling"), is("a sibling")); assertThat(LanguageUtils.addArticle("rotary dish"), is("a rotary dish")); assertThat(LanguageUtils.addArticle("user"), is("a user")); }
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);  }