Create a public class named Restaurant
providing a single constructor setting three private String
properties:
id, name, and cuisine, in that order.
Reject null
String
s in your constructor by throwing an IllegalArgumentException
.
Implement hashCode
using java.util.Objects
by hashing the restaurant's id and name, only, in that
order.
You're challenge is to write tests for this problem described above.
Stuck? You may find these lessons helpful: