java records and sealed classes