{ public int compare (Object o1, Object o2) { Task t1 = (Task) o1; Task t2 = (Task) o2; int i1 = t1.getAssignment().getTaskStartTime(); int i2 = t2.getAssignment().getTaskStartTime(); int diff = i1 - i2; if (diff != 0) return diff; i1 = o1.hashCode(); i2 = o2.hashCode(); diff = i1 - i2; if (diff != 0) return diff; return t1.getKey().hashCode() - t2.getKey().hashCode(); }});
public int compare (Object o1, Object o2) { try { Task t1 = (Task) o1; Task t2 = (Task) o2; Assignment a1 = t1.getAssignment(); int i1 = a1.getTaskStartTime(); Assignment a2 = t2.getAssignment(); int i2 = a2.getTaskStartTime(); int diff = i1 - i2; if (diff != 0) return diff; i1 = o1.hashCode(); i2 = o2.hashCode(); diff = i1 - i2; if (diff != 0) return diff; return t1.getKey().hashCode() - t2.getKey().hashCode(); } catch (Exception e) { System.err.println ("Got exception comparing " + o1 + " and " + o2); e.printStackTrace(); return 0; } }});
                 { public int compare (Object o1, Object o2) {                   Task t1 = (Task) o1;                   Task t2 = (Task) o2;                   int i1 = t1.getAssignment().getTaskStartTime();                   int i2 = t2.getAssignment().getTaskStartTime();                   int diff = i1 - i2;                   if (diff != 0)                     return diff;                   i1 = o1.hashCode();                   i2 = o2.hashCode();                   diff = i1 - i2;                   if (diff != 0)                     return diff;                   return t1.getKey().hashCode() - t2.getKey().hashCode();                 }});