AxiomUtils { public static String toLanguage(Locale locale) { return locale.toString().replace('_', '-'); }  static OMNamespace toNamespace(QName qName, OMElement resolveElement); static String toLanguage(Locale locale); static Locale toLocale(String language); static void removeContents(OMContainer container); static Document toDocument(SOAPEnvelope envelope); static SOAPEnvelope toEnvelope(Document document);  }
@Test public void testToLanguage() throws Exception { Assert.assertEquals("Invalid conversion", "fr-CA", AxiomUtils.toLanguage(Locale.CANADA_FRENCH)); Assert.assertEquals("Invalid conversion", "en", AxiomUtils.toLanguage(Locale.ENGLISH)); }