You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Compares this String to another String, ignoring case considerations. Two strings are considered equal ignoring case if they are of the same length and corresponding characters in the two strings are equal ignoring case.
217
+
* Two characters c1 and c2 are considered the same ignoring case if at least one of the following is true:
218
+
* <ul>
219
+
* <li>The two characters are the same (as compared by the == operator)</li>
220
+
* <li>Calling Character.toLowerCase(Character.toUpperCase(char)) on each character produces the same result</li>
221
+
* </ul>
222
+
*
223
+
* @param a String
224
+
* @param b String to be compared with {@code a} for equality (ignoring case considerations)
225
+
* @param executableFunction lambda function given executed if the provided Strings are equals (ignoring case considerations).
* Compares this String to another String, ignoring case considerations. Two strings are considered not equal ignoring case if they are of the not same length and corresponding characters in the two strings are not equal ignoring case.
235
+
*
236
+
* @param a String
237
+
* @param b String to be compared with {@code a} for non equality (ignoring case considerations)
238
+
* @param executableFunction lambda function given executed if the provided Strings are non equals (ignoring case considerations).
Assertions.assertThrows(RuntimeException.class, () -> Strings.equals("A", "A", () -> {thrownewRuntimeException("Function executed when two Strings are equal");}));
107
+
Strings.equals("A", "a", () -> {thrownewRuntimeException("Function won't execute when two Strings are equal with ignore case");});
108
+
Strings.equals("A", "B", () -> {thrownewRuntimeException("Function won't execute when two Strings are not equal");});
109
+
}
110
+
111
+
@Test
112
+
publicvoidtest_notEquals(){
113
+
Assertions.assertThrows(RuntimeException.class, () -> Strings.notEquals("A", "B", () -> {thrownewRuntimeException("Function executed when two Strings are not equal");}));
114
+
Strings.notEquals("A", "A", () -> {thrownewRuntimeException("Function won't execute when two Strings are equal");});
115
+
}
116
+
117
+
@Test
118
+
publicvoidtest_equalsIgnoreCase(){
119
+
Assertions.assertThrows(RuntimeException.class, () -> Strings.equalsIgnoreCase("A", "A", () -> {thrownewRuntimeException("Function executed when two Strings are equalsIgnoreCase");}));
120
+
Assertions.assertThrows(RuntimeException.class, () -> Strings.equalsIgnoreCase("A", "a", () -> {thrownewRuntimeException("Function executed when two Strings are equalsIgnoreCase");}));
121
+
Strings.equalsIgnoreCase("A", "b", () -> {thrownewRuntimeException("Function won't execute when two Strings are not equalsIgnoreCase");});
122
+
}
123
+
124
+
@Test
125
+
publicvoidtest_notEqualsIgnoreCase(){
126
+
Assertions.assertThrows(RuntimeException.class, () -> Strings.notEqualsIgnoreCase("A", "B", () -> {thrownewRuntimeException("Function executed when two Strings are not equalsIgnoreCase");}));
127
+
Assertions.assertThrows(RuntimeException.class, () -> Strings.notEqualsIgnoreCase("A", "b", () -> {thrownewRuntimeException("Function executed when two Strings are not equalsIgnoreCase");}));
128
+
Strings.notEqualsIgnoreCase("A", "a", () -> {thrownewRuntimeException("Function won't execute when two Strings are equalsIgnoreCase");});
0 commit comments