diff --git a/src/main/java/strman/Strman.java b/src/main/java/strman/Strman.java index ba22b9c..7d68723 100644 --- a/src/main/java/strman/Strman.java +++ b/src/main/java/strman/Strman.java @@ -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) { diff --git a/src/test/java/strman/StrmanTest.java b/src/test/java/strman/StrmanTest.java index f7b1df9..f510324 100644 --- a/src/test/java/strman/StrmanTest.java +++ b/src/test/java/strman/StrmanTest.java @@ -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)); + } + } \ No newline at end of file