@@ -0,0 +1,1340 @@
+package com.javarush.task.task16.task1605;%0A%0Aimport java.util.Date;%0A%0A/* %0A%D0%9F%D0%BE%D0%B3%D0%BE%D0%B2%D0%BE%D1%80%D0%B8%D0%BC %D0%BE %D0%BC%D1%83%D0%B7%D1%8B%D0%BA%D0%B5%0A*/%0A%0Apublic class Solution %7B%0A    public static int delay = 1000;%0A%0A    public static void main(String%5B%5D args) %7B%0A        Thread violin = new Thread(new Violin(%22Player%22));%0A        violin.start();%0A    %7D%0A%0A    public static void sleepNSeconds(int n) %7B%0A        try %7B%0A            Thread.sleep(n * delay);%0A        %7D catch (InterruptedException e) %7B%0A            e.printStackTrace();%0A        %7D%0A    %7D%0A%0A    public interface MusicalInstrument extends Runnable %7B%0A        Date startPlaying();%0A%0A        Date stopPlaying();%0A    %7D%0A%0A    public static class Violin implements MusicalInstrument %7B%0A        private String owner;%0A%0A        @Override%0A        public void run() %7B%0A            Date startDate = startPlaying();%0A            sleepNSeconds(1);%0A            Date stopDate = stopPlaying();%0A            System.out.println(%22Playing %22 + (stopDate.getTime() - startDate.getTime()) + %22 ms%22);%0A        %7D%0A%0A        public Violin(String owner) %7B%0A            this.owner = owner;%0A        %7D%0A%0A        public Date startPlaying() %7B%0A            System.out.println(this.owner + %22 starts playing%22);%0A            return new Date();%0A        %7D%0A%0A        public Date stopPlaying() %7B%0A            System.out.println(this.owner + %22 stops playing%22);%0A            return new Date();%0A        %7D%0A    %7D%0A%7D%0A

Complete task1605