CaseUtil { public static String upperCaseUnderscoreToHumanFriendly( String upperCaseUnderscoreString) { if (upperCaseUnderscoreString == null) { return null; } String[] parts = upperCaseUnderscoreString.replaceFirst("^_*", "") .split("_"); for (int i = 0; i < parts.length; i++) { parts[i] = capitalize(parts[i].toLowerCase(Locale.ROOT)); } return String.join(" ", parts); } private  CaseUtil(); static String upperCaseUnderscoreToHumanFriendly(
            String upperCaseUnderscoreString); static String capitalize(String string);  }
@Test public void upperCaseUnderscoreToHumanFriendly() { assertNull(CaseUtil.upperCaseUnderscoreToHumanFriendly(null)); assertEquals("", CaseUtil.upperCaseUnderscoreToHumanFriendly("")); assertEquals("My Bean Container", CaseUtil .upperCaseUnderscoreToHumanFriendly("MY_BEAN_CONTAINER")); assertEquals("Awesome Url Factory", CaseUtil .upperCaseUnderscoreToHumanFriendly("AWESOME_URL_FACTORY")); assertEquals("Something", CaseUtil.upperCaseUnderscoreToHumanFriendly("SOMETHING")); }