StringHelper { public static String toOracleName(String s) { StringBuilder result = new StringBuilder(); String currChar; if (s != null && !s.isEmpty()) { for (int i = 0; i < s.length(); i++) { currChar = s.substring(i, i + 1); if (i != 0 && StringUtils.isAllUpperCase(currChar)) { result.append("_" + currChar); } else { result.append(currChar); } } } return result.toString().toUpperCase().replaceAll("\\_\\_", "_"); } private  StringHelper(); static String toCamelCase(String s); static String toCamelCaseSmallBegin(String s); static String toOracleName(String s); static boolean isJavaKeyword(String s); static String unJavaKeyword(String s);  }
@Test public void testToOracleName() { Assert.assertEquals("HELLO_WORLD", StringHelper.toOracleName("hello_world")); Assert.assertEquals("HELLO_WORLD", StringHelper.toOracleName("HelloWorld")); Assert.assertEquals("HELLO_WORLD", StringHelper.toOracleName("helloWorld")); }