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:
2018-10-27 08:55:15 +02:00
parent 8bb98deb1e
commit 8b48b8c3e7
4 changed files with 67 additions and 12 deletions

View File

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