If you don't wish to model this as an ADT with sea...
# server
r
If you don't wish to model this as an ADT with sealed classes which in my opinion is a superior solution for this you could just translate those Java classes to regular Kotlin classes and then you can implement equals, hashcode, etc in the same way.