The mysteryMethod is equivalent to a single pass of the Bubble Sort algorithm, it “bubbles” the largest element to the end of the list. The boolean value returned by the method indicates whether any swaps too place. If there are no swaps, then the list is already sorted and mysteryMethod returns false.
The mysteriousMethod is basically Bubble Sort on a linked list, it calls the mysteryMethod until the list is sorted, i.e. until mysteryMethod returns false.