@@ -0,0 +1,1684 @@
+package com.javarush.task.task16.task1620;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/* %0A%D0%9E%D0%B4%D0%B8%D0%BD %D0%B4%D0%BB%D1%8F %D0%B2%D1%81%D0%B5%D1%85, %D0%B2%D1%81%D0%B5 - %D0%B4%D0%BB%D1%8F %D0%BE%D0%B4%D0%BD%D0%BE%D0%B3%D0%BE%0A*/%0A%0Apublic class Solution %7B%0A    public static byte countThreads = 3;%0A    static List%3CThread%3E threads = new ArrayList%3CThread%3E(countThreads);%0A%0A    public static void main(String%5B%5D args) throws InterruptedException %7B%0A        initThreadsAndStart();%0A        Thread.sleep(3000);%0A        ourInterruptMethod();%0A    %7D%0A%0A    public static void ourInterruptMethod() %7B%0A        //add your code here - %D0%B4%D0%BE%D0%B1%D0%B0%D0%B2%D1%8C %D0%BA%D0%BE%D0%B4 %D1%82%D1%83%D1%82%0A        for (int i = 0; i %3C countThreads; i++) %7B%0A            threads.get(i).interrupt();%0A        %7D%0A    %7D%0A%0A    private static void initThreadsAndStart() %7B%0A        Water water = new Water(%22water%22);%0A        for (int i = 0; i %3C countThreads; i++) %7B%0A            threads.add(new Thread(water, %22#%22 + i));%0A        %7D%0A%0A        for (int i = 0; i %3C countThreads; i++) %7B%0A            threads.get(i).start();%0A        %7D%0A    %7D%0A%0A    public static class Water implements Runnable %7B%0A        private String commonResource;%0A%0A        public Water(String commonResource) %7B%0A            this.commonResource = commonResource;%0A        %7D%0A%0A        public void run() %7B%0A            //fix 2 variables - %D0%B8%D1%81%D0%BF%D1%80%D0%B0%D0%B2%D1%8C 2 %D0%BF%D0%B5%D1%80%D0%B5%D0%BC%D0%B5%D0%BD%D0%BD%D1%8B%D1%85%0A            boolean isCurrentThreadInterrupted = Thread.currentThread().isInterrupted();%0A            String threadName = Thread.currentThread().getName();%0A%0A            try %7B%0A                while (!isCurrentThreadInterrupted) %7B%0A%0A                    System.out.println(%22%D0%9E%D0%B1%D1%8A%D0%B5%D0%BA%D1%82 %22 + commonResource + %22, %D0%BD%D0%B8%D1%82%D1%8C %22 + threadName);%0A                    Thread.sleep(1000);%0A                %7D%0A            %7D catch (InterruptedException e) %7B%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Complete task1620