add a pointer to the root node
Before the offset of the root node was hard-coded. Now the offset of the pointer to the root node is hard-coded. That allows us to replace the root node.
This commit is contained in:
@@ -29,4 +29,21 @@ public class Preconditions {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that the given values are equal. The check is done with
|
||||
* {@link Objects#equals(Object, Object)}
|
||||
*
|
||||
* @param actual the actual value
|
||||
* @param expected the expected value
|
||||
* @param message formatted with {@link MessageFormat}
|
||||
* @param args arguments for the message
|
||||
*/
|
||||
public static void checkEqual(final Object actual, final Object expected, final String message,
|
||||
final Object... args) {
|
||||
if (!Objects.equals(actual, expected)) {
|
||||
throw new IllegalStateException(
|
||||
MessageFormat.format(message, args) + " Expected: " + actual + " equals " + expected);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user