StringUtils { public static boolean equalsIgnoreCase(String a, String b) { if (a == null) { return b == null; } return a.equalsIgnoreCase(b); } private  StringUtils(); static boolean isNullOrEmpty(String str); static boolean isBlank(String str); static boolean isNotBlank(String str); static boolean equals(String a, String b); static boolean equalsIgnoreCase(String a, String b); static String inputStream2String(InputStream is); static byte[] inputStream2Bytes(InputStream is); static String toString(Object obj); static final String EMPTY; }
@Test void testEqualsIgnoreCase() { Assertions.assertTrue(StringUtils.equalsIgnoreCase("a", "a")); Assertions.assertTrue(StringUtils.equalsIgnoreCase("a", "A")); Assertions.assertTrue(StringUtils.equalsIgnoreCase("A", "a")); Assertions.assertFalse(StringUtils.equalsIgnoreCase("1", "2")); Assertions.assertFalse(StringUtils.equalsIgnoreCase(null, "1")); Assertions.assertFalse(StringUtils.equalsIgnoreCase("1", null)); Assertions.assertFalse(StringUtils.equalsIgnoreCase("", null)); Assertions.assertFalse(StringUtils.equalsIgnoreCase(null, "")); }