Skip to content

Commit 46e721b

Browse files
committed
add method
1 parent cf8aeb1 commit 46e721b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/de/tilman_neumann/util/Ensure.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static void ensureSmallerEquals(long left, long right) {
4848
}
4949

5050
public static void ensureEquals(long left, long right) {
51-
if (! (left == right)) {
51+
if (left != right) {
5252
throw new AssertionError("Assertion failed: " + left + " == " + right);
5353
}
5454
}
@@ -65,6 +65,12 @@ public static void ensureGreater(long left, long right) {
6565
}
6666
}
6767

68+
public static void ensureNotEquals(long left, long right) {
69+
if (left == right) {
70+
throw new AssertionError("Assertion failed: " + left + " != " + right);
71+
}
72+
}
73+
6874
// BigInteger comparison
6975

7076
public static void ensureSmaller(BigInteger left, BigInteger right) {

0 commit comments

Comments
 (0)