public class GwtLocaleTest extends TestCase {
private GwtLocaleFactory factory = new GwtLocaleFactoryImpl();
public void testAliases() {
GwtLocale en = factory.fromString("en");
List<GwtLocale> aliases = en.getAliases();
assertEquals(aliases.get(0), en);
GwtLocale enLatn = factory.fromString("en_Latn");
assertContainsAndGetPosition(aliases, enLatn);
assertTrue(en.usesSameScript(enLatn));
assertTrue(enLatn.inheritsFrom(en));
assertFalse(en.inheritsFrom(enLatn));
assertFalse(en.inheritsFrom(en));
GwtLocale pt = factory.fromString("pt");
aliases = pt.getAliases();
assertContainsAndGetPosition(aliases, factory.fromString("pt_BR"));
GwtLocale iw = factory.fromString("iw");
aliases = iw.getAliases();
GwtLocale he = factory.fromString("he");
assertEquals(aliases.get(0), he);
assertContainsAndGetPosition(aliases, factory.fromString("iw_Hebr"));
aliases = he.getAliases();
assertContainsAndGetPosition(aliases, factory.fromString("iw_Hebr"));
GwtLocale id = factory.fromString("id");
aliases = id.getAliases();
assertContainsAndGetPosition(aliases, factory.fromString("in"));
GwtLocale mo = factory.fromString("mo");
aliases = mo.getAliases();
assertContainsAndGetPosition(aliases, factory.fromString("ro"));
GwtLocale jv = factory.fromString("jv");
aliases = jv.getAliases();
assertContainsAndGetPosition(aliases, factory.fromString("jw"));
GwtLocale ji = factory.fromString("ji");
aliases = ji.getAliases();
assertContainsAndGetPosition(aliases, factory.fromString("yi"));
}