@Test void shouldNotCreateAnAuthorWithNullFirstname() { Author author = new Author().firstName(null); tx.begin(); em.persist(author); assertThrows(RollbackException.class, () -> tx.commit()); }
public Author firstName(String firstName) { this.firstName = firstName; return this; }
Author { public Author firstName(String firstName) { this.firstName = firstName; return this; } }
Author { public Author firstName(String firstName) { this.firstName = firstName; return this; }  }
Author { public Author firstName(String firstName) { this.firstName = firstName; return this; }  Long getId(); void setId(Long id); String getFirstName(); void setFirstName(String firstName); Author firstName(String firstName); String getLastName(); void setLastName(String lastName); Author lastName(String lastName); String getBio(); void setBio(String bio); Author surnbioame(String bio); String getEmail(); void setEmail(String email); Author email(String email); }
Author { public Author firstName(String firstName) { this.firstName = firstName; return this; }  Long getId(); void setId(Long id); String getFirstName(); void setFirstName(String firstName); Author firstName(String firstName); String getLastName(); void setLastName(String lastName); Author lastName(String lastName); String getBio(); void setBio(String bio); Author surnbioame(String bio); String getEmail(); void setEmail(String email); Author email(String email);  }