src/textgen/MyLinkedListTester.java
@Test
	public void testSet()
	{
        try {
            list1.set(-1,47);
            fail("Check out of bounds");
        }
        catch (IndexOutOfBoundsException e)
        {}
        try {
            list1.set(16,47);
            fail("Check out of bounds");
        }
        catch (IndexOutOfBoundsException e)
        {}
        try {
            list1.add(0,null);
            fail("Check your element value");
        }
        catch (NullPointerException e)
        {}

        int a=list1.set(0,56);
        assertEquals("Set: check if 65 is the one that changed",65,a);
        int b=list1.get(0);
        assertEquals("Set: check if 65 actually changed to 56",56,b);


	    // TODO: implement this test(DONE)
	    
	}
/** Test setting an element in the list */
Test setting an element in the list
Test setting an element in the list
@Test
	public void testSet()
	{
        try {
            list1.set(-1,47);
            fail("Check out of bounds");
        }
        catch (IndexOutOfBoundsException e)
        {}
        try {
            list1.set(16,47);
            fail("Check out of bounds");
        }
        catch (IndexOutOfBoundsException e)
        {}
        try {
            list1.add(0,null);
            fail("Check your element value");
        }
        catch (NullPointerException e)
        {}
        int a=list1.set(0,56);
        assertEquals("Set: check if 65 is the one that changed",65,a);
        int b=list1.get(0);
        assertEquals("Set: check if 65 actually changed to 56",56,b);
	}
@ Test public void testSet ( ) { try { list1 . set ( - 1 , 47 ) ; fail ( "Check out of bounds" ) ; } catch ( IndexOutOfBoundsException e ) { } try { list1 . set ( 16 , 47 ) ; fail ( "Check out of bounds" ) ; } catch ( IndexOutOfBoundsException e ) { } try { list1 . add ( 0 , null ) ; fail ( "Check your element value" ) ; } catch ( NullPointerException e ) { } int a = list1 . set ( 0 , 56 ) ; assertEquals ( "Set: check if 65 is the one that changed" , 65 , a ) ; int b = list1 . get ( 0 ) ; assertEquals ( "Set: check if 65 actually changed to 56" , 56 , b ) ; }
Test setting an element in the list
Test setting an element in the list
// TODO: implement this test(DONE)