import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import java.util.NoSuchElementException;

import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;

public class SimpleLinkedListTest {

    @Rule
    public ExpectedException expectedException = ExpectedException.none();

    @Test
    public void aNewListIsEmpty() {
        SimpleLinkedList list = new SimpleLinkedList();
        assertThat(list.size(), is(0));
    }

    @Ignore("Remove to run test")
    @Test
    public void canCreateFromArray() {
        Integer[] values = new Integer[]{1, 2, 3};
        SimpleLinkedList list = new SimpleLinkedList(values);
        assertThat(list.size(), is(3));
    }

    @Ignore("Remove to run test")
    @Test
    public void popOnEmptyListWillThrow() {
        expectedException.expect(NoSuchElementException.class);
        SimpleLinkedList list = new SimpleLinkedList();
        list.pop();
    }

    @Ignore("Remove to run test")
    @Test
    public void popReturnsLastAddedElement() {
        SimpleLinkedList list = new SimpleLinkedList();
        list.push(9);
        list.push(8);
        assertThat(list.size(), is(2));
        assertThat(list.pop(), is(8));
        assertThat(list.pop(), is(9));
        assertThat(list.size(), is(0));
    }

    @Ignore("Remove to run test")
    @Test
    public void reverseReversesList() {
        SimpleLinkedList list = new SimpleLinkedList();
        list.push(9);
        list.push(8);
        list.push(7);
        list.push(6);
        list.push(5);
        list.reverse();
        assertThat(list.pop(), is(9));
        assertThat(list.pop(), is(8));
        assertThat(list.pop(), is(7));
        assertThat(list.pop(), is(6));
        assertThat(list.pop(), is(5));
    }

    @Ignore("Remove to run test")
    @Test
    public void canReturnListAsArray() {
        SimpleLinkedList list = new SimpleLinkedList();
        list.push(9);
        list.push(8);
        list.push(7);
        list.push(6);
        list.push(5);
        Integer[] expected = {5, 6, 7, 8, 9};
        assertArrayEquals(expected, list.asArray(Integer.class));
    }

    @Ignore("Remove to run test")
    @Test
    public void canReturnEmptyListAsEmptyArray() {
        SimpleLinkedList list = new SimpleLinkedList();
        Object[] expected = {};
        assertArrayEquals(expected, list.asArray(Object.class));
    }

}

@@ -412,32 +412,41 @@
 SimpleLinkedList
+%3CInteger%3E
  list = new Simp
@@ -449,32 +449,34 @@
 SimpleLinkedList
+%3C%3E
 ();%0A        asse
@@ -597,29 +597,31 @@
 ) %7B%0A        
-Integ
+Charact
 er%5B%5D values 
@@ -630,25 +630,33 @@
 new 
-Integer%5B%5D%7B1, 2, 3
+Character%5B%5D%7B'1', '2', '3'
 %7D;%0A 
@@ -670,32 +670,43 @@
 SimpleLinkedList
+%3CCharacter%3E
  list = new Simp
@@ -717,16 +717,27 @@
 nkedList
+%3CCharacter%3E
 (values)
@@ -953,32 +953,40 @@
 SimpleLinkedList
+%3CString%3E
  list = new Simp
@@ -989,32 +989,40 @@
 SimpleLinkedList
+%3CString%3E
 ();%0A        list
@@ -1143,32 +1143,41 @@
 SimpleLinkedList
+%3CInteger%3E
  list = new Simp
@@ -1180,32 +1180,41 @@
 SimpleLinkedList
+%3CInteger%3E
 ();%0A        list
@@ -1510,32 +1510,40 @@
 SimpleLinkedList
+%3CString%3E
  list = new Simp
@@ -1546,32 +1546,40 @@
 SimpleLinkedList
+%3CString%3E
 ();%0A        list
@@ -1576,33 +1576,35 @@
       list.push(
-9
+%229%22
 );%0A        list.
@@ -1600,33 +1600,35 @@
       list.push(
-8
+%228%22
 );%0A        list.
@@ -1624,33 +1624,35 @@
       list.push(
-7
+%227%22
 );%0A        list.
@@ -1648,33 +1648,35 @@
       list.push(
-6
+%226%22
 );%0A        list.
@@ -1672,33 +1672,35 @@
       list.push(
-5
+%225%22
 );%0A        list.
@@ -1736,33 +1736,35 @@
 (list.pop(), is(
-9
+%229%22
 ));%0A        asse
@@ -1777,33 +1777,35 @@
 (list.pop(), is(
-8
+%228%22
 ));%0A        asse
@@ -1826,17 +1826,19 @@
 p(), is(
-7
+%227%22
 ));%0A    
@@ -1867,17 +1867,19 @@
 p(), is(
-6
+%226%22
 ));%0A    
@@ -1908,17 +1908,19 @@
 p(), is(
-5
+%225%22
 ));%0A    
@@ -2023,32 +2023,43 @@
 SimpleLinkedList
+%3CCharacter%3E
  list = new Simp
@@ -2062,32 +2062,43 @@
 SimpleLinkedList
+%3CCharacter%3E
 ();%0A        list
@@ -2095,33 +2095,35 @@
       list.push(
-9
+'9'
 );%0A        list.
@@ -2119,33 +2119,35 @@
       list.push(
-8
+'8'
 );%0A        list.
@@ -2151,17 +2151,19 @@
 st.push(
-7
+'7'
 );%0A     
@@ -2175,17 +2175,19 @@
 st.push(
-6
+'6'
 );%0A     
@@ -2199,17 +2199,19 @@
 st.push(
-5
+'5'
 );%0A     
@@ -2213,21 +2213,23 @@
         
-Integ
+Charact
 er%5B%5D exp
@@ -2241,21 +2241,31 @@
  = %7B
-5, 6, 7, 8, 9
+'5', '6', '7', '8', '9'
 %7D;%0A 
@@ -2312,21 +2312,23 @@
 asArray(
-Integ
+Charact
 er.class
@@ -2457,16 +2457,24 @@
 nkedList
+%3CObject%3E
  list = 
@@ -2493,16 +2493,24 @@
 nkedList
+%3CObject%3E
 ();%0A    

use generics