FList<E> (E elem) { FList<E> front = emptyList(); FList<E> current = this; while (!current.isEmpty()) { if (elem == null ? current.myHead == null : current.myHead.equals(elem)) { FList<E> result = current.myTail; while (!front.isEmpty()) { result = result.prepend(front.myHead); front = front.myTail; } return result; } front = front.prepend(current.myHead); current = current.myTail; } return this; }