### Question:
CodeGenUtils { public static String getJavaCodeName(String str, boolean insertUnderscoreOnCaseChange, boolean startUppercase) { if (str.length() == 0) { return str; } StringBuilder result = new StringBuilder(); String firstChar = str.substring(0, 1); result.append(startUppercase ? firstChar.toUpperCase() : firstChar); int idx = 1; while (idx < str.length()) { char prevChar = str.charAt(idx - 1); char currChar = str.charAt(idx); boolean isCaseChange = isLowerCase(prevChar) && isUpperCase(currChar); boolean isWordSep = prevChar == '_'; boolean changeCase = isCaseChange || isWordSep; if (changeCase) { if (insertUnderscoreOnCaseChange) { result.append("_"); } if (currChar != '_') { result.append(toUpperCase(currChar)); } } else { if (currChar != '_') { result.append(currChar); } } idx++; } return result.toString(); }  static String escapeSqlStringForJavaSourceFile(String line); static String getJavaCodeName(String str,
                                         boolean insertUnderscoreOnCaseChange,
                                         boolean startUppercase); static String escapeSqlStringForJavaDoc(String line); static String firstCharUpperCase(String name); static String joinStringsAsPackageName(String... packageNames); static String getSubPathFromFileInParent(String parent, String childInParent); static File getFileFromBaseDirAndPackageName(File baseDir, String packageName); static File getOutputFile(File exportRootDir, String packageName, String fileName); static void writeContent(String content, File target); static void rollback(LSql lSql); static void log(String... strings);  }### Answer:
@Test public void getJavaCodeNameTests() { assertEquals(getJavaCodeName( "a", false, false), "a"); assertEquals(getJavaCodeName( "a", false, true), "A"); assertEquals(getJavaCodeName( "abc_def", false, false), "abcDef"); assertEquals(getJavaCodeName( "abc_def", false, true), "AbcDef"); assertEquals(getJavaCodeName( "abc_def", true, true), "Abc_Def"); assertEquals(getJavaCodeName( "abc___def", false, false), "abcDef"); assertEquals(getJavaCodeName( "abc___def", true, false), "abc___Def"); assertEquals(getJavaCodeName( "idInteger", true, true), "Id_Integer"); }