diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsStartsEndsWithTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsStartsEndsWithTest.java index 9d6a3c478..27d7b09ee 100644 --- a/src/test/java/org/apache/commons/lang3/StringUtilsStartsEndsWithTest.java +++ b/src/test/java/org/apache/commons/lang3/StringUtilsStartsEndsWithTest.java @@ -84,6 +84,19 @@ public class StringUtilsStartsEndsWithTest extends TestCase { assertFalse("startsWithIgnoreCase(FOOBAR, bar)", StringUtils.startsWithIgnoreCase(FOOBAR, bar)); } + public void testStartsWithAny() { + assertFalse(StringUtils.startsWithAny(null, (String[])null)); + assertFalse(StringUtils.startsWithAny(null, "abc")); + assertFalse(StringUtils.startsWithAny("abcxyz", (String[])null)); + assertFalse(StringUtils.startsWithAny("abcxyz")); + assertTrue(StringUtils.startsWithAny("abcxyz", "abc")); + assertTrue(StringUtils.startsWithAny("abcxyz", null, "xyz", "abc")); + assertFalse(StringUtils.startsWithAny("abcxyz", null, "xyz", "abcd")); + + assertTrue("StringUtils.startsWithAny(abcxyz, StringBuilder(xyz), StringBuffer(abc))", StringUtils.startsWithAny("abcxyz", new StringBuilder("xyz"), new StringBuffer("abc"))); + assertTrue("StringUtils.startsWithAny( StrBuilder(abcxyz), StringBuilder(xyz), StringBuffer(abc))", StringUtils.startsWithAny( new StrBuilder("abcxyz"), new StringBuilder("xyz"), new StringBuffer("abc"))); + } + /** * Test StringUtils.endsWith() diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsTest.java index c4073db6e..5e2aa479b 100644 --- a/src/test/java/org/apache/commons/lang3/StringUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/StringUtilsTest.java @@ -26,7 +26,6 @@ import java.util.Locale; import junit.framework.TestCase; -import org.apache.commons.lang3.text.StrBuilder; import org.apache.commons.lang3.text.WordUtils; /** @@ -1864,19 +1863,6 @@ public class StringUtilsTest extends TestCase { assertEquals("i am a ", StringUtils.getCommonPrefix("i am a machine", "i am a robot")); } - public void testStartsWithAny() { - assertFalse(StringUtils.startsWithAny(null, (String[])null)); - assertFalse(StringUtils.startsWithAny(null, "abc")); - assertFalse(StringUtils.startsWithAny("abcxyz", (String[])null)); - assertFalse(StringUtils.startsWithAny("abcxyz")); - assertTrue(StringUtils.startsWithAny("abcxyz", "abc")); - assertTrue(StringUtils.startsWithAny("abcxyz", null, "xyz", "abc")); - assertFalse(StringUtils.startsWithAny("abcxyz", null, "xyz", "abcd")); - - assertTrue("StringUtils.startsWithAny(abcxyz, StringBuilder(xyz), StringBuffer(abc))", StringUtils.startsWithAny("abcxyz", new StringBuilder("xyz"), new StringBuffer("abc"))); - assertTrue("StringUtils.startsWithAny( StrBuilder(abcxyz), StringBuilder(xyz), StringBuffer(abc))", StringUtils.startsWithAny( new StrBuilder("abcxyz"), new StringBuilder("xyz"), new StringBuffer("abc"))); - } - public void testNormalizeSpace() { assertEquals(null, StringUtils.normalizeSpace(null)); assertEquals("", StringUtils.normalizeSpace(""));