Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
record FullName(String firstName, String lastName) {}
@Test
void testRecords() {
var fullName = new FullName("Mitsuyuki", "Shiiba");
assertEquals("Mitsuyuki", fullName.firstName());
assertEquals("Shiiba", fullName.lastName());
assertEquals("FullName[firstName=Mitsuyuki, lastName=Shiiba]", fullName.toString());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment