insertion of many values into the persistent map

This commit is contained in:
2018-11-04 10:11:10 +01:00
parent c6782df0e5
commit f2d5c27668
8 changed files with 467 additions and 197 deletions

View File

@@ -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);
}
}
}