### Question:
Utils { static String pluralize(String string) { string = string.toLowerCase(Locale.US); if (string.endsWith("s")) { return string; } else if (string.endsWith("ay")) { return string.replaceAll("ay$", "ays"); } else if (string.endsWith("ey")) { return string.replaceAll("ey$", "eys"); } else if (string.endsWith("oy")) { return string.replaceAll("oy$", "oys"); } else if (string.endsWith("uy")) { return string.replaceAll("uy$", "uys"); } else if (string.endsWith("y")) { return string.replaceAll("y$", "ies"); } else { return string + "s"; } } private  Utils();   }### Answer:
@Test public void pluralize() { String expected = "whiskies"; String actual = Utils.pluralize("Whisky"); assertEquals(expected, actual); expected = "ytitties"; actual = Utils.pluralize("YTitty"); assertEquals(expected, actual); expected = "ways"; actual = Utils.pluralize("Way"); assertEquals(expected, actual); expected = "boys"; actual = Utils.pluralize("Boy"); assertEquals(expected, actual); expected = "journeys"; actual = Utils.pluralize("Journey"); assertEquals(expected, actual); expected = "beers"; actual = Utils.pluralize("Beer"); assertEquals(expected, actual); expected = "ballantines"; actual = Utils.pluralize("Ballantines"); assertEquals(expected, actual); }
@Test public void pluralizeWithDifferentLocale() { String expected = "interests"; String actual; Locale current = Locale.getDefault(); try { Locale.setDefault(Locale.forLanguageTag("tr")); actual = Utils.pluralize("Interest"); } finally { Locale.setDefault(current); } assertEquals(expected, actual); }