Strings { static boolean containsIgnoreCase(String str, String searchStr) { if (str == null || searchStr == null) { return false; } if (searchStr.isEmpty()) { return true; } final int len = searchStr.length(); final int max = str.length() - len; for (int i = 0; i <= max; i++) { if (str.regionMatches(true, i, searchStr, 0, len)) { return true; } } return false; }  static boolean isNullOrEmpty(String string); static String sha256(String string); static String hexString(byte[] bytes);  }
@Test public void testContainsIgnoreCase() { assertTrue(Strings.containsIgnoreCase("Favorites", "")); assertTrue(Strings.containsIgnoreCase("Favorites", "F")); assertTrue(Strings.containsIgnoreCase("Favorites", "Fa")); assertTrue(Strings.containsIgnoreCase("Font Size", "Fo")); assertTrue(Strings.containsIgnoreCase("Font Size", "fo")); assertTrue(Strings.containsIgnoreCase("Font Size", "fO")); assertTrue(Strings.containsIgnoreCase("Font Size", "nt si")); assertTrue(Strings.containsIgnoreCase("Scaling & Ordering", "ord")); assertFalse(Strings.containsIgnoreCase(null, "Fo")); assertFalse(Strings.containsIgnoreCase("Favorites", null)); assertFalse(Strings.containsIgnoreCase("Favorites", "Fo")); assertFalse(Strings.containsIgnoreCase("Scaling & Ordering", "awdawdhwhd")); }