This time, if we call buyFruit(seed) we get the message, This is a seed of Fairytale from India. The call matches the case SeedRecord(String type, String country) branch. And, if
Using generic records in record patterns 2 – Record and record patternUsing generic records in record patterns 2 – Record and record pattern
Certification Exams of Java Java Exams Tackling guarded record patterns Tackling records in Spring Boot