Write a class that satisfies the following UML diagram and has two constructors: one that assigns available to true (default - you choose the default values to use) and another one that sets the name and year attributes via the parameter. Renting the media makes it unavailable (if it is currently unavailable, display a message that it cannot be rented) and returning it makes it available again.
Movie
- available : boolean
- name : String
- year : int
+ rentMovie()
+ returnMovie()
+ isAvailable() : boolean
+ equals(obj : Object) : boolean
+ toString() : String
The equals method should compare the year and title of the two objects. The toString method should return a String such as "Movie Title (1900)".