All numeric values are represented as primitive values in the JVM unless it is a nullable value. For example, if Long? or generics are involved. Kotlin has a ternary equals operator (===) that can be used to check identity. Consider the following code example:
var a : Long = 10L;
println(a === a)
The following code will print true:
var a : Long = 10L;
var b : Long? = a;
var c : Long? = a;
println(b === c)
However, it will print false if the b and c variables are nullable, will not use primitive data types, and thus will have different identities for each of those respectively. Yet println(b == c) will print true as it will be checking equality, not the identity.