CaseHelper { public static String camelCaseToUpperSnakeCase(String camelCase) { return camelCaseToSnakeCase(camelCase).toUpperCase(); } private  CaseHelper(); static String camelCaseToSnakeCase(String camelCase); static String camelCaseToUpperSnakeCase(String camelCase); static String lowerCaseFirst(String string); static String upperCaseFirst(String string); static String camelCaseToUpperSnakeCase(String prefix, String camelCase, String suffix);  }
@Test public void testCamelCaseToUpperSnakeCaseString() throws Exception { Assert.assertEquals("CAMEL_CASE", CaseHelper.camelCaseToUpperSnakeCase("camelCase")); Assert.assertEquals("CAMEL_CASE", CaseHelper.camelCaseToUpperSnakeCase("camel_case")); Assert.assertEquals("CAMEL_CASE", CaseHelper.camelCaseToUpperSnakeCase("Camel_Case")); }
@Test public void testCamelCaseToUpperSnakeCaseStringStringString() throws Exception { Assert.assertEquals("CAMEL_CASE", CaseHelper.camelCaseToUpperSnakeCase(null, "camelCase", null)); Assert.assertEquals("CAMEL2_CASE", CaseHelper.camelCaseToUpperSnakeCase(null, "camel2Case", null)); Assert.assertEquals("PREFIX_CAMEL_CASE", CaseHelper.camelCaseToUpperSnakeCase("prefix", "camelCase", null)); Assert.assertEquals("PREFIX_CAMEL_CASE", CaseHelper.camelCaseToUpperSnakeCase("prefix", "prefixCamelCase", null)); Assert.assertEquals("CAMEL_CASE_SUFFIX", CaseHelper.camelCaseToUpperSnakeCase(null, "camelCase", "suffix")); Assert.assertEquals("CAMEL_CASE_SUFFIX", CaseHelper.camelCaseToUpperSnakeCase(null, "camelCaseSuffix", "suffix")); Assert.assertEquals("PREFIX_CAMEL_CASE_SUFFIX", CaseHelper.camelCaseToUpperSnakeCase("prefix", "camelCase", "suffix")); }