Add the following methods to the MyArrayList class. Be sure to make these methods work with
the generic type version of the MyArrayList. Do not submit code that relies on the Java ArrayList
or the Collections framework to support this portion of assignment. Think about what each
method needs to do, and make it work within your customized MyArrayList class.
a. count(x): Returns the number of occurrences of x in the list
b. lastIndexOf(x): Returns the last index of x in the list and -1 if x is not in the list
c. rotate(): Shift elements of the list so that the last item is now first and everything else
shifts right by one position
d. rotate(n): Shift elements of the list forward or backward depending on value of n. Be
sure to account for beginning and end of the list