@@ -0,0 +1,1191 @@
+package com.javarush.task.task16.task1606;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/* %0Ajoin: %D0%B2 %D0%BD%D1%83%D0%B6%D0%BD%D0%BE%D0%B5 %D0%B2%D1%80%D0%B5%D0%BC%D1%8F %D0%B2 %D0%BD%D1%83%D0%B6%D0%BD%D0%BE%D0%BC %D0%BC%D0%B5%D1%81%D1%82%D0%B5%0A*/%0A%0Apublic class Solution %7B%0A    public static void main(String%5B%5D args) throws InterruptedException %7B%0A        PrintListThread firstThread = new PrintListThread(%22firstThread%22);%0A        PrintListThread secondThread = new PrintListThread(%22secondThread%22);%0A        firstThread.start();%0A        firstThread.join();%0A        secondThread.start();%0A    %7D%0A%0A    public static void printList(List%3CString%3E list, String threadName) %7B%0A        for (String item : list) %7B%0A            System.out.println(String.format(%22%25s : %25s%22, threadName, item));%0A        %7D%0A    %7D%0A%0A    public static List%3CString%3E getList(int n) %7B%0A        List%3CString%3E result = new ArrayList%3CString%3E();%0A        if (n %3C 1) return result;%0A%0A        for (int i = 0; i %3C n; i++) %7B%0A            result.add(String.format(%22String %25d%22, (i + 1)));%0A        %7D%0A        return result;%0A    %7D%0A%0A    public static class PrintListThread extends Thread %7B%0A        public PrintListThread(String name) %7B%0A            super(name);%0A        %7D%0A%0A        public void run() %7B%0A            printList(getList(20), getName());%0A        %7D%0A    %7D%0A%7D%0A

Complete task1606