@@ -0,0 +1,1682 @@
+package by.vorokhobko.Collections_Framework;%0A%0Aimport java.util.Collection;%0Aimport java.util.Iterator;%0A%0A/**%0A * CollectionExample.%0A *%0A * Class CollectionExample determines the performance of the collections part 005_Lite, lesson 1.%0A * @author Evgeny Vorokhobko (vorokhobko2011@yandex.ru).%0A * @since 01.06.2017.%0A * @version 1.%0A */%0Apublic class CollectionExample %7B%0A    /**%0A     * The method add element in collections.%0A     * @param collection - collection.%0A     * @param amount - amount.%0A     * @return tag.%0A     */%0A    public long addCollection(Collection%3CString%3E collection, int amount) %7B%0A        String%5B%5D array = new String%5Bamount%5D;%0A        long start = System.currentTimeMillis();%0A        for (int i = 0; i %3C array.length; i++) %7B%0A            array%5Bi%5D = %22qwerty%22;%0A            collection.add(array%5Bi%5D);%0A        %7D%0A        long timeWorkCode = System.currentTimeMillis() - start;%0A        return timeWorkCode;%0A    %7D%0A    /**%0A     * The method delete element in collections.%0A     * @param collection - collection.%0A     * @param amount - amount.%0A     * @return tag.%0A     */%0A    public long deleteCollection(Collection%3CString%3E collection, int amount) %7B%0A        String%5B%5D array = new String%5Bamount%5D;%0A        for (int i = 0; i %3C array.length; i++) %7B%0A            array%5Bi%5D = %22qwerty%22;%0A            collection.add(array%5Bi%5D);%0A        %7D%0A        long start = System.currentTimeMillis();%0A        for (Iterator%3CString%3E list = collection.iterator(); list.hasNext();) %7B%0A            String text = list.next();%0A            if (text.equals(%22qwerty%22)) %7B%0A                list.remove();%0A            %7D%0A        %7D%0A        long timeWorkCode = System.currentTimeMillis() - start;%0A        return timeWorkCode;%0A    %7D%0A%7D

add class CollectionExample