equals
Returns true if the other object is an instance of Integer with the same value as this one, or returns false otherwise.
Calling from Kotlin
Here's an example of calling this function from Kotlin code:
// Given
val number: Long = Long.MAX_VALUE
val x: Integer = Integer.from(number)
val y: Integer = Integer.from(number)
// When
val result: Boolean = x == y
// Then
check(result)Content copied to clipboard
Calling from Java
Here's an example of calling this function from Java code:
// Given
final long number = Long.MAX_VALUE;
final Integer x = Integer.from(number);
final Integer y = Integer.from(number);
// When
final boolean result = x.equals(y);
// Then
if (!result) throw new IllegalStateException("Check failed.");Content copied to clipboard