import java.util.*; interface Sortable { /* *This interface models a protocol for things that can sorted relative to each other */ //Interface Sortable Methods //============================ public boolean canCompare(Sortable aSortable); //answer whether this Sortable and aSortable can be compared //this method should answer true if the object this and aSortable are instances of the same class //This could be implemented as follows /* if(( this instanceof SomeClass ) && (aSortable instanceof SomeClass)) return true; else { System.out.println("canCompare: ERROR: OBJECTS ARE NOT COMPARABLE"); return false; } */ public boolean comesBefore(Sortable aSortable); //answer whether this Sortable should come before aSortable in sorted order //this method should check that this and aSortable are can be compared and if not //an error message should be printed public boolean comesAfter(Sortable aSortable); //answer whether this Sortable should come after aSortable in sorted order //this method should check that this and aSortable are can be compared and if not //an error message should be printed }