/** * Compare two instances of the object and there relative offset that is needed for ordering * this objects. */ @Override public int compare(final DisplayItem o1, final DisplayItem o2) { return o2.getZOrder() - o1.getZOrder(); }