StringUtil { public static boolean startsWithIgnoreCase(final String string, final String prefix) throws IllegalArgumentException, NullPointerException { Validate.notNull(string, "Cannot check a null string for a match"); if (string.length() < prefix.length()) { return false; } return string.regionMatches(true, 0, prefix, 0, prefix.length()); }  static T copyPartialMatches(final String token, final Iterable<String> originals, final T collection); static boolean startsWithIgnoreCase(final String string, final String prefix);  }
@Test(expected=NullPointerException.class) public void nullPrefixTest() { StringUtil.startsWithIgnoreCase("String", null); }
@Test(expected=IllegalArgumentException.class) public void nullStringTest() { StringUtil.startsWithIgnoreCase(null, "String"); }