public interface MyList { // appends elem to the end public void add( E elem ); // inserts elem at index // shifts the current and any subsequent elements down public void add( int index, E elem ); // replaces the element at index with elem // returns the element previously at index public E set( int index, E elem ); // returns the element at index public E get( int index ); // removes first occurrence of elem if found, // shift subsequent elemenets up, and return true, // else return false and no changes are made public boolean remove( E elem ); // removes the element at index and shifts subsequent elements up // returns the element that was removed public E remove( int index ); // removes all of the elements from this list public void clear(); // returns the index of the first occurrence of elem // or -1 if elem not found public int indexOf( E elem ); // returns the index of the last occurrence of elem // or -1 if elem not found public int lastIndexOf( E elem ); // returns true if this list contains elem, false otherwise public boolean contains( E elem ); // returns true if list has no elements, false otherwise public boolean isEmpty(); // returns the number of elements in list // returns Integer.MAX_VALUE, if size > Integer.MAX_VALUE elements public int size(); }