package ru.matevosyan;

import org.junit.Test;

import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import java.util.ArrayList;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;


public class EfficiencyListTest {

    private static final int STRINGAMOUNT = 2000;
    private static final int STRINGTODELETE = 100;

    @Test
    public void whenAddThousandAndFiveToTreeSetThanReturnFive() {

        //assign
        final String LN = System.getProperty("line.separator");
        Set<String> treeSet = new TreeSet<>();

        EfficiencyList efficiencyList = new EfficiencyList();

        //act
        System.out.printf("TreeSet%s", LN);

        long timeAddTeeSet = efficiencyList.add(treeSet, "treeSet", STRINGAMOUNT);
        int expectedTreeSet = treeSet.size();
        long timeRemoveTreeSet = efficiencyList.delete(treeSet, STRINGTODELETE);

        System.out.printf(String.format("Add time --- %s%sRemove time  --- %s%s", timeAddTeeSet, LN,
                timeRemoveTreeSet, LN));
        //assert
        assertThat(treeSet.size(), is(1900));
        assertThat(expectedTreeSet, is(STRINGAMOUNT));
    }
    @Test
    public void whenAddThousandAndFiveToArrayListThanReturnFive() {

        //assign
        final String LN = System.getProperty("line.separator");
        List<String> arrayList = new ArrayList<>();

        EfficiencyList efficiencyList = new EfficiencyList();

        //act
        System.out.printf("ArrayList%s", LN);

        long timeAddArray = efficiencyList.add(arrayList, "ArrayList", STRINGAMOUNT);
        int expectedArrayList = arrayList.size();
        long timeRemoveArray = efficiencyList.delete(arrayList, STRINGTODELETE);

        System.out.printf(String.format("Add time --- %s%sRemove time --- %s%s",
                timeAddArray, LN, timeRemoveArray, LN));

        //assert
        assertThat(arrayList.size(), is(1900));
        assertThat(expectedArrayList, is(STRINGAMOUNT));
    }

    @Test
    public void whenAddThousandAndFiveToLinkedListThanReturnFive() {

        //assign
        final String LN = System.getProperty("line.separator");
        List<String> linkedList = new LinkedList<>();

        EfficiencyList efficiencyList = new EfficiencyList();

        //act
        System.out.printf("LinkedList%s", LN);

        long timeAddLinkedList = efficiencyList.add(linkedList, "Linked", STRINGAMOUNT);
        int expectedLinkedList = linkedList.size();
        long timeRemoveLinkedList = efficiencyList.delete(linkedList, STRINGTODELETE);

        System.out.print(String.format("Add time --- %s%sRemove time --- %s%s", timeAddLinkedList, LN,
                timeRemoveLinkedList, LN));

        //assert
        assertThat(linkedList.size(), is(1900));
        assertThat(expectedLinkedList, is(STRINGAMOUNT));
    }



}
@@ -268,144 +268,484 @@
 s;%0A%0A
-%0Apublic class EfficiencyListTest %7B%0A%0A    private static final int STRINGAMOUNT = 2000;%0A    private static final int STRINGTODELETE = 100;
+/**%0A * EfficiencyListTest was created to test EfficiencyList class.%0A * Created on 28.04.2017.%0A * @author Matevosyan Vardan%0A * @version 1.0%0A */%0A%0Apublic class EfficiencyListTest %7B%0A%0A    private static final int STRINGAMOUNT = 2000;%0A    private static final int STRINGTODELETE = 100;%0A%0A    /**%0A     * whenAddThousandAndFiveToTreeSetThanReturnFive was created.%0A     * to test add and delete method to the treeSet and check how many.%0A     * was added and how many lines left.%0A     */
 %0A%0A  
@@ -799,34 +799,33 @@
 oTreeSetThan
-ReturnFive
+CheckLast
 () %7B%0A%0A      
@@ -1546,16 +1546,217 @@
 ;%0A    %7D%0A
+%0A    /**%0A     * whenAddThousandAndFiveToArrayListThanCheckLast was created.%0A     * to test add and delete method to the arrayList and check how many.%0A     * was added and how many lines left.%0A     */%0A%0A
     @Tes
@@ -1806,34 +1806,33 @@
 rrayListThan
-ReturnFive
+CheckLast
 () %7B%0A%0A      
@@ -2565,24 +2565,226 @@
 T));%0A    %7D%0A%0A
+    /**%0A     * whenAddThousandAndFiveToLinkedListThanCheckLast was created.%0A     * to test add and delete method to the linkedList and check how many.%0A     * was added and how many lines left.%0A     */%0A%0A
     @Test%0A  
@@ -2835,26 +2835,25 @@
 ListThan
-ReturnFive
+CheckLast
 () %7B%0A%0A  

add javadoc