package org.junit.jupiter.api;
import static org.junit.jupiter.api.AssertionUtils.fail;
import static org.junit.jupiter.api.AssertionUtils.format;
import static org.junit.jupiter.api.AssertionUtils.nullSafeGet;
import java.util.function.Supplier;
class AssertSame {
private AssertSame() {
}
static void assertSame(Object expected, Object actual) {
assertSame(expected, actual, (String) null);
}
static void assertSame(Object expected, Object actual, String message) {
if (expected != actual) {
failNotSame(expected, actual, message);
}
}
static void assertSame(Object expected, Object actual, Supplier<String> messageSupplier) {
if (expected != actual) {
failNotSame(expected, actual, nullSafeGet(messageSupplier));
}
}
private static void failNotSame(Object expected, Object actual, String message) {
fail(format(expected, actual, message), expected, actual);
}
}