errln("Did not get the expected alias"); } if(!aliases.contains("UTF-16BE")){
    public void TestUTF16Converter(){        CharsetProviderICU icu = new CharsetProviderICU();        Charset icuChar = icu.charsetForName("UTF-16");        Set aliases = icuChar.aliases();        Iterator iter = aliases.iterator();        while(iter.hasNext()){            logln((String)iter.next());        }        if(!aliases.contains("csUnicode")){            errln("Did not get the expected alias");        }        char[] expchars = new char[]{'\ud800','\udc00','\ud801','\udc01'};        byte[] expbytes = new byte[]{(byte)0xd8,0x00,(byte)0xdc,0x00, (byte)0xd8,0x01,(byte)0xdc,0x01};        {            try{                CharsetEncoder enc =icuChar.newEncoder();                CharBuffer in = CharBuffer.wrap(expchars);                ByteBuffer out = enc.encode(in);                if(!equals(out,expbytes)){                    errln("did not get the expected output");                }            }catch(CharacterCodingException ex){                errln(ex.getMessage());            }        }        {            try{                CharsetDecoder dec =icuChar.newDecoder();                ByteBuffer in = ByteBuffer.wrap(expbytes);                CharBuffer out = dec.decode(in);                if(!equals(out,expchars)){                    errln("did not get the expected output");                }            }catch(CharacterCodingException ex){                errln(ex.getMessage());            }        }            }