This commit is contained in:
Shekhar Gulati
2016-06-26 22:10:03 +05:30
parent e251cc07d8
commit dfc05347bf
2 changed files with 20 additions and 1 deletions
+13 -1
View File
@@ -488,6 +488,18 @@ public abstract class Strman {
* @param second The second String
* @return true if first and second are not equal false otherwise
*/
public static boolean unequal(final String first, final String second) {
return !Objects.equals(first, second);
}
/**
* Tests if two Strings are inequal
*
* @param first The first String
* @param second The second String
* @return true if first and second are not equal false otherwise
* @deprecated use unequal instead
*/
public static boolean inequal(final String first, final String second) {
return !Objects.equals(first, second);
}
@@ -1043,7 +1055,7 @@ public abstract class Strman {
* Decamelize String
*
* @param value The input String
* @param chr string to use
* @param chr string to use
* @return String decamelized.
*/
public static String toDecamelize(final String value, final String chr) {
+7
View File
@@ -819,5 +819,12 @@ public class StrmanTest {
Arrays.stream(fixture).forEach(el -> assertThat(String.format("toSnakeCase(%s) should be de_camelize", el), toSnakeCase(el), equalTo("de_camelize")));
}
@Test
public void unequal_shouldTestInequalityOfStrings() throws Exception {
assertThat(unequal("a", "b"), equalTo(true));
assertThat(unequal("a", "a"), equalTo(false));
assertThat(unequal("0", "1"), equalTo(true));
}
}