They're unrelated, this class I'm building is actually the "relationship" I'd like to build. The other way I could solve this is if I could tell the compiler to generate the equalsAndHashCode and toString for me without specifying this as a data class