@Test public void testCompare() { assertTrue(StringUtil.compare(null, null)); assertFalse(StringUtil.compare(null, "hello")); assertFalse(StringUtil.compare("hello", null)); assertTrue(StringUtil.compare("hello", "hello")); assertTrue(StringUtil.compare("", "")); assertFalse(StringUtil.compare("HelLo", "hello")); assertFalse(StringUtil.compare("hello", "hello there")); }
public static boolean compare(String string1, String string2) { return (string1 != null && string1.equals(string2)) || (string1 == null && string2 == null); }
StringUtil { public static boolean compare(String string1, String string2) { return (string1 != null && string1.equals(string2)) || (string1 == null && string2 == null); } }
StringUtil { public static boolean compare(String string1, String string2) { return (string1 != null && string1.equals(string2)) || (string1 == null && string2 == null); }  }
StringUtil { public static boolean compare(String string1, String string2) { return (string1 != null && string1.equals(string2)) || (string1 == null && string2 == null); }  static boolean isEmpty(String str); static boolean compare(String string1, String string2); }
StringUtil { public static boolean compare(String string1, String string2) { return (string1 != null && string1.equals(string2)) || (string1 == null && string2 == null); }  static boolean isEmpty(String str); static boolean compare(String string1, String string2);  }