try { CharSetUtils.translate("hello", null, null); fail("Expecting NullPointerException"); } catch (NullPointerException ex) {} try { CharSetUtils.translate("hello", "h", null); fail("Expecting NullPointerException"); } catch (NullPointerException ex) {} try { CharSetUtils.translate("hello", null, "a"); fail("Expecting NullPointerException"); } catch (NullPointerException ex) {} try { CharSetUtils.translate("hello", "h", ""); fail("Expecting ArrayIndexOutOfBoundsException"); } catch (ArrayIndexOutOfBoundsException ex) {}
assertEquals("hello", CharSetUtils.translate("hello", "", ""));  assertEquals("q651.506bera", CharSetUtils.translate("d216.102oren", "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789", "nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM567891234"));
    public void testTranslate() {        assertEquals(null, CharSetUtils.translate(null, null, null));        assertEquals("", CharSetUtils.translate("","a", "b"));        assertEquals("jelly", CharSetUtils.translate("hello", "ho", "jy"));        assertEquals("jellj", CharSetUtils.translate("hello", "ho", "j"));        assertEquals("jelly", CharSetUtils.translate("hello", "ho", "jyx"));        assertEquals("\rhello\r", CharSetUtils.translate("\nhello\n", "\n", "\r"));        assertEquals("hello", CharSetUtils.translate("hello", "", "x"));        assertEquals("hello", CharSetUtils.translate("hello", "", ""));        try {            CharSetUtils.translate("hello", null, null);            fail("Expecting NullPointerException");        } catch (NullPointerException ex) {}        try {            CharSetUtils.translate("hello", "h", null);            fail("Expecting NullPointerException");        } catch (NullPointerException ex) {}        try {            CharSetUtils.translate("hello", null, "a");            fail("Expecting NullPointerException");        } catch (NullPointerException ex) {}        try {            CharSetUtils.translate("hello", "h", "");            fail("Expecting ArrayIndexOutOfBoundsException");        } catch (ArrayIndexOutOfBoundsException ex) {}    }         