1. package cop3530; public interface List { boolean contains( AnyType x ); int size( ); boolean isEmpty( ); void add( AnyType x ); void clear( ); } 2. package cop3530; public class ArrayList implements List { private AnyType [ ] items; private int theSize; public String toString( ) { StringBuilder sb = new StringBuilder( "[" ); for( int i = 0; i < theSize; i++ ) sb.append( " " + items[ i ] ); sb.append( " ]" ); return new String( sb ); } public void add( AnyType x ) { if( theSize == items.length ) { AnyType [ ] old = items; items = (AnyType []) new Object[ old.length * 2 + 1 ]; for( int i = 0; i < old.length; i++ ) items[ i ] = old[ i ]; } items[ theSize++ ] = x; } ... }