NameUtils { public static String canonicalizeForEnumTypes(final String name) { return name.toUpperCase().replaceAll("-", "_"); }  static String canonicalizeForEnumTypes(final String name); static String decanonicalizeFromEnumTypes(final String name);  }
@Test public void canonicalizeName() { assertEquals("FOO", NameUtils.canonicalizeForEnumTypes("foo")); assertEquals("FOO", NameUtils.canonicalizeForEnumTypes("FOO")); assertEquals("FOOBAR", NameUtils.canonicalizeForEnumTypes("fooBar")); assertEquals("FOOBAR", NameUtils.canonicalizeForEnumTypes("FooBar")); assertEquals("FOO_BAR", NameUtils.canonicalizeForEnumTypes("foo_bar")); assertEquals("FOO_BAR", NameUtils.canonicalizeForEnumTypes("Foo_Bar")); assertEquals("FOO_BAR", NameUtils.canonicalizeForEnumTypes("foo-bar")); assertEquals("FOO_BAR", NameUtils.canonicalizeForEnumTypes("Foo-Bar")); assertEquals("FOO_BAR", NameUtils.canonicalizeForEnumTypes("FOO_BAR")); }