Adding getSize() method to the LinkedList class.