src/textgen/MyLinkedListTester.java
/** 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 {
			emptyList.set(1, 3);
		} catch(IndexOutOfBoundsException e){
			System.out.println("gotcha..");
		}
		try {
			emptyList.set(0, 1);
		} catch(IndexOutOfBoundsException e){
			System.out.println("gotcha..");
		}	
	}
@ Test public void testSet ( ) { try { emptyList . set ( 1 , 3 ) ; } catch ( IndexOutOfBoundsException e ) { System . out . println ( "gotcha.." ) ; } try { emptyList . set ( 0 , 1 ) ; } catch ( IndexOutOfBoundsException e ) { System . out . println ( "gotcha.." ) ; } }
Test setting an element in the list
Test setting an element in the list
// check if valid index: index<0 ; index>=size // check if element is not null