package ru.apetrov.list;

import org.junit.Test;

import java.util.Iterator;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.*;

/**
 * Created by Andrey on 13.03.2017.
 */
public class SimpleLinkedListTest {

    @Test
    public void whenAddNewElementThenChekThisElement() {
        SimpleLinkedList<String> list = new SimpleLinkedList<>();
        list.add("test");
        list.add("test");

        assertThat(list.get(1), is("test"));
    }

    @Test
    public void whenNotHasNextThenGetFalse() {
        SimpleLinkedList<String> list = new SimpleLinkedList<>();
        list.add("test");
        list.add("test");
        Iterator<String> iterator = list.iterator();
        iterator.next();
        iterator.next();
        assertFalse(iterator.hasNext());
    }

}
@@ -782,16 +782,311 @@
 Next());
+%0A%0A    %7D    @Test%0A    public void whenHasNextThenGetTrue() %7B%0A        SimpleLinkedList%3CString%3E list = new SimpleLinkedList%3C%3E();%0A        list.add(%22test%22);%0A        list.add(%22test%22);%0A        Iterator%3CString%3E iterator = list.iterator();%0A        iterator.next();%0A        assertTrue(iterator.hasNext());
 %0A    %7D%0A%0A

update SimpleLinkedList