Inflector { public static String humanize(String camelCased) { List<String> parts = Inflector.split(camelCased); for (int i = 0; i < parts.size(); i++) { parts.set(i, Inflector.capitalize(parts.get(i).toLowerCase())); } return Join.space(parts); } private  Inflector(); static String underscore(String camelCased); static String camelize(String s); static String humanize(String camelCased); static String capitalize(String str); static String uncapitalize(String str);  }
@Test public void testHumanize() { Assert.assertEquals("Test One", Inflector.humanize("testOne")); Assert.assertEquals("Test One", Inflector.humanize("TestOne")); Assert.assertEquals("Test One O", Inflector.humanize("TestOneO")); Assert.assertEquals("Test One 19", Inflector.humanize("TestOne19")); Assert.assertEquals("Test Url 91 Foo", Inflector.humanize("TestURL91Foo")); Assert.assertEquals("Test One", Inflector.humanize("test_one")); Assert.assertEquals("Test One", Inflector.humanize("TEST_ONE")); Assert.assertEquals("Test 12", Inflector.humanize("test12")); }
@Test public void testHumanizeWithTwo() { Assert.assertEquals("Test One Two", Inflector.humanize("testOneTwo")); Assert.assertEquals("Test One Two", Inflector.humanize("TestOneTwo")); Assert.assertEquals("Test One Two", Inflector.humanize("test_one_two")); Assert.assertEquals("Test One Two", Inflector.humanize("TEST_ONE_TWO")); Assert.assertEquals("Test A B", Inflector.humanize("test_a_b")); Assert.assertEquals("Test A B", Inflector.humanize("TEST_A_B")); }
@Test public void testTaxId() { Assert.assertEquals("Tax Id", Inflector.humanize("TaxId")); }