public class Main { public static void main(String[] args) { List151Impl test = new List151Impl<>(10); try { for (int i = 0; i < 400; i++) { test.add(i); } } catch (MAxSizeExceededException mxe) { System.err.println("They do not fit"); } test.display(); test.clear(); test.display(); try { for (int i = 0; i < 40; i++) { test.add(i); } } catch (MAxSizeExceededException mxe) { System.err.println("They do not fit"); } System.out.println("\n\nTest 3"); try { for (int i = 1; i < 70; i++) { test.add(i*2, i + 2000); } } catch (MAxSizeExceededException mxe) { System.err.println("They do not fit"); } catch (IndexOutOfBoundsException iobe) { System.err.println("Illegal access attempt " + iobe.toString()); } test.display(); } }