package ru.matevosyan;


import java.util.Collection;
import java.util.Iterator;

public class EfficiencyList {

    private long efficiencyTime;



    public long add(Collection<String> collection, String line, int amount) {
        this.efficiencyTime = System.currentTimeMillis();
        for(int i = 0; i < amount; i++) {
            collection.add(line + i);
        }
        return this.efficiencyTime = System.currentTimeMillis() - this.efficiencyTime;
    }
    public long delete(Collection<String> collection, int amount) {
        this.efficiencyTime = System.currentTimeMillis();

        Iterator<String> iterator = collection.iterator();

        int i = 0;
        while(iterator.hasNext() && (i < amount)) {

            iterator.next();
            iterator.remove();
            i++;
        }
        return this.efficiencyTime = System.currentTimeMillis() - this.efficiencyTime;
    }

}

@@ -17,17 +17,16 @@
 osyan;%0A%0A
-%0A
 import j
@@ -78,73 +78,635 @@
 r;%0A%0A
-public class EfficiencyList %7B%0A%0A    private long efficiencyTime;%0A%0A
+%0A/**%0A * EfficiencyList was created to see how list and set have works.%0A * Created on 28.04.2017.%0A * @author Matevosyan Vardan%0A * @version 1.0%0A */%0A%0Apublic class EfficiencyList %7B%0A%0A    private long efficiencyTime;%0A%0A    /**%0A     * add method adding amount times string value to a collection%3CString%3E%3C/%3E.%0A     * @param collection passing to the add method to be filled by lines.%0A     * @param line string value that adding to a collection with iterable value i.%0A     * @param amount it's mean how many times line would be added to the collection.%0A     * @return times in milliseconds, it is mean how long collection fills up.%0A     */
 %0A%0A  
@@ -1018,24 +1018,339 @@
 Time;%0A    %7D%0A
+%0A    /**%0A     * delete method deleting amount times string value from a collection%3CString%3E%3C/%3E.%0A     * @param collection use to remove lines from the collection that passed to method.%0A     * @param amount it's mean how many times line would be added to the collection.%0A     * @return times in milliseconds.%0A     */%0A%0A
     public l

add javadoc