import java.text.DecimalFormat; import java.text.NumberFormat; public class test2 { static public void main(String[] args) { double points=0.0; double maxpoints=0.0; NumberFormat f = new DecimalFormat("0.00"); // test empty (0.1 point) ListReferenceBased L=new ListReferenceBased(); if (L.isEmpty()) points+=0.05; if (L.size()==0) points+=0.05; maxpoints+=0.1; // test add, get, remove at position 0 in empty list (0.15 point) L=new ListReferenceBased(); try { L.add(0,new Integer(10)); } catch (ListIndexOutOfBoundsException e) { points+=0.05; } catch (Exception e) { // wrong type of exception points+=0.05; } L=new ListReferenceBased(); try { L.remove(0); } catch (ListIndexOutOfBoundsException e) { points+=0.05; } catch (Exception e) { // wrong type of exception points+=0.025; } L=new ListReferenceBased(); try { L.get(0); } catch (ListIndexOutOfBoundsException e) { points+=0.05; } catch (Exception e) { // wrong type of exception points+=0.025; } maxpoints+=0.15; // test add, remove,get at position 2 in the empty list (0.15 point) L=new ListReferenceBased(); try { L.add(2,new Integer(10)); } catch (ListIndexOutOfBoundsException e) { points+=0.05; } catch (Exception e) { // wrong type of exception points+=0.025; } L=new ListReferenceBased(); try { L.remove(1); } catch (ListIndexOutOfBoundsException e) { points+=0.05; } catch (Exception e) { // wrong type of exception points+=0.025; } L=new ListReferenceBased(); try { L.get(1); } catch (ListIndexOutOfBoundsException e) { points+=0.05; } catch (Exception e) { // wrong type of exception points+=0.025; } maxpoints+=0.15; int max=20; // test adding at the beginning (0.25 point) L=new ListReferenceBased(); try { for (int i=0; i