I'm trying to sort a `LinkedList` based on the `Attribute` priority

Flight Class
------------

```
/**
 * @author Dylan
 *
 */

/**
 * A Class to hold information for flights and allow it to be manipulated
 *
 */
public class Flight {
    private String flightID;//FlightId eg(BA001)
    Integer priority; // 1 = lowest | 9 = highest

    /**
     * A simple constructor to initialise sensible values to attributes
     */
    public Flight() {
        this.setFlightID("BA378"); //initialises the attributes to sensible values
        this.setPriority(1); //initialises the attributes to sensible values
    }
    /**
     * A param constrctor to initials attributes to values of params
     * @param flightID
     * @param priority
     */
    public Flight(String flightID, Integer priority) {
        this.flightID = flightID; // Initialises flightID to the value of the param
        this.priority = priority;// initialises priority to the value of the param
    }

    /**
     * A simple method to return the flightID
     * @return
     */
    public String getFlightID() {
        return flightID; //returns flightID
    }

    /**
     * A simple method to set the flightID
     * @param flightID
     */
    public void setFlightID(String flightID) {
        this.flightID = flightID; //sets value of flightID to params
    }

    /**
     * a simple method to return the priority of the flight
     * @return
     */
    public Integer getPriority() {
        return priority;//returns priority of the flight
    }

    /**
     * a simple method to set the priority of the flight
     * @param priority
     */
    public void setPriority(int priority) {
        this.priority = priority;//sets the flight priority to value of params
    }
    /**
     * A method to turn attributes into a sensible string
     */
    public String toString() {
        return "Flight [flightID=  " + flightID + ", priority=" + priority + "]";//toString to change attributes into a string that's easy to read
    }
}

```

PriorityFlightQueue1 Class
--------------------------

```
import java.util.Comparator;
import java.util.Iterator;
import java.util.LinkedList;

public class PriorityFlightQueue1 extends AbstractFlightQueue implements Comparator<Flight> {
    LinkedList<Object> flights = new LinkedList<Object>();

    public void joinQueue(Flight f) {
        flights.addLast(f);

    }

    public Object landFlight() {
        return flights.removeFirst();
    }

    public int size() {
        return flights.size();
    }

    public void clear() {
        Iterator<Object> it = flights.iterator();//Initialise iterator to it
        while(it.hasNext()) {//A While loop to check if there's another index after the current index
            flights.removeFirst();//If the condition is true then it will remove index
        }
    }

    public void display() {
        for(Object f : flights) {//for each statement
        System.out.println(f);//prints out f to console
        }

    }

    public int compare(Flight f1, Flight f2) {
        if(f1.getPriority() < f2.getPriority()){
            return 1;
        } else {
            return -1;
        }
}
}

```

Method from `FlightTestClass`, This basically puts data into the linked list. I'm trying to sort that data with the `Collections.sort()` as you can see below

```
public void testPriorityFlightQueue1() {
        PriorityFlightQueue1    q = new PriorityFlightQueue1();

        Flight f1 = new Flight("BA001", 3);//entering flight details into the linkedlist(queue)
        Flight f2 = new Flight("NR273", 7);//entering flight details into the linkedlist(queue)
        Flight f3 = new Flight("RA291", 1);//entering flight details into the linkedlist(queue)
        Flight fref;

        showPriorityFlightQueue1(q);
        q.joinQueue(f1);
        System.out.println(f1 + " has joined the queue to land");
        showPriorityFlightQueue1(q);
        q.joinQueue(f2);
        System.out.println(f2 + " has joined the to land");
        showPriorityFlightQueue1(q);
        q.joinQueue(f3);
        System.out.println(f3 + " has joined the to land");
        showPriorityFlightQueue1(q);
        System.out.println("\n-----------------------------------------\n");    
        fref = (Flight) q.landFlight();
        System.out.println(fref + " has landed");
        showPriorityFlightQueue1(q);
        fref = (Flight) q.landFlight();
        System.out.println(fref + " has landed");
        showPriorityFlightQueue1(q);
        fref = (Flight) q.landFlight();
        System.out.println(fref + " has landed");
        showPriorityFlightQueue1(q);
        System.out.println("\n-----------------------------------------\n");

        Collections.sort(q.flights);

        showPriorityFlightQueue1(q);

    }

```

I really not sure as to why it won't sort the `LinkedList`
In Eclipse the suggestion box says:

> 
> The method sort(List) in the type Collections is not applicable for the arguments (LinkedList)
> 
> 
> 

Then it wants me to Cast argument `q.flights` to `List<T>`.