/** * Asserts that an object is null. If it is not, an AssertionFailedError, with the given message, * is thrown. * * @param object the assertion object * @param message the assertion error message */ private static void assertNull(Object object, String message) { if (object != null) { if (haultonfailure) failNotSame(object, null, message); else { if (map == null) map = new LinkedHashMap<String, String>(); map.put( "expected a null array, but not null found. " + SEPARATOR + message + System.currentTimeMillis(), "null" + SEPARATOR + object); } } }
/** * Asserts that two objects refer to the same object. If they do not, an AssertionFailedError, * with the given message, is thrown. * * @param actual the actual value * @param expected the expected value * @param message the assertion error message */ private static void assertSame(Object actual, Object expected, String message) { if (expected == actual) { return; } failNotSame(actual, expected, message); }