// To compile: // // javac *.java // // To run: // // java AListTests // This class defines a main method for testing the EmptyAList class, // which implements the AList interface. class ALists { private static AList theEmptyAList = new EmptyAList(); // static factory method for creating an empty AList @SuppressWarnings("unchecked") public static ,V> AList empty () { return (AList) theEmptyAList; } // // this generates a new EmptyAList object every time it is called. // public static AList empty () { // return new EmptyAList (); // } public static void main (String[] args) { Tests.main (args); } }