assertEquals("replace(String, String, String) failed", "FOO", StringUtils.replace("FOO", "", "any")); assertEquals("replace(String, String, String) failed", "FOO", StringUtils.replace("FOO", null, "any")); assertEquals("replace(String, String, String) failed", "FOO", StringUtils.replace("FOO", "F", null)); assertEquals("replace(String, String, String) failed", "FOO", StringUtils.replace("FOO", null, null)); assertEquals("replace(String, String, String) failed", null, StringUtils.replace(null, "", "any"));
    public void testReplaceFunctions()    {        assertEquals("replace(String, String, String, int) failed",                     FOO, StringUtils.replace("oo" + FOO, "o", "", 2));        assertEquals("replace(String, String, String) failed",                     "", StringUtils.replace(FOO + FOO + FOO, FOO, ""));        assertEquals("replaceOnce(String, String, String) failed",                     FOO, StringUtils.replaceOnce(FOO + FOO, FOO, ""));        assertEquals("carriage-return replace(String,String,String) failed",                     "test123", StringUtils.replace("test\r1\r2\r3", "\r", ""));    }