insertion of many values into the persistent map
This commit is contained in:
@@ -24,12 +24,23 @@ public class Preconditions {
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkEqual(final Object actual, final Object expected) {
|
||||
if (!Objects.equals(actual, expected)) {
|
||||
throw new IllegalStateException();
|
||||
/**
|
||||
*
|
||||
* @param a
|
||||
* @param b
|
||||
* @param message formatted with {@link MessageFormat}
|
||||
* @param args
|
||||
*/
|
||||
public static void checkGreaterOrEqual(final long a, final long b, final String message, final Object... args) {
|
||||
if (a < b) {
|
||||
throw new IllegalStateException(MessageFormat.format(message, args) + " Expected: " + a + " >= " + b);
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkEqual(final Object actual, final Object expected) {
|
||||
checkEqual(actual, expected, "expected {0} is equal to {1}", actual, expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that the given values are equal. The check is done with
|
||||
* {@link Objects#equals(Object, Object)}
|
||||
@@ -46,4 +57,5 @@ public class Preconditions {
|
||||
MessageFormat.format(message, args) + " Expected: " + actual + " equals " + expected);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user