Your task is to add a rotate method to the LinkedList class of Section 15.2 that rotates the elements of a linked list so that the second element becomes the first, the third the second, and so on. The first element becomes the last element. For example, after rotating the list containing the elements

Mary, had, a, little, lamb

the list becomes

had, a, little, lamb, Mary