@@ -0,0 +1,1376 @@
+package com.javarush.task.task14.task1416;%0A%0A/* %0A%D0%98%D1%81%D0%BF%D1%80%D0%B0%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5 %D0%BE%D1%88%D0%B8%D0%B1%D0%BE%D0%BA%0A*/%0A%0Apublic class Solution %7B%0A    public static void main(String%5B%5D args) %7B%0A        Swimmable animal = new Orca();%0A        animal.swim();%0A        animal = new Whale();%0A        animal.swim();%0A        animal = new Otter();%0A        animal.swim();%0A    %7D%0A%0A    public static void test(Swimmable animal) %7B%0A        animal.swim();%0A    %7D%0A%0A    interface Walkable %7B%0A        void walk();%0A    %7D%0A%0A    interface Swimmable %7B%0A        void swim();%0A    %7D%0A%0A    static abstract class OceanAnimal implements Swimmable %7B%0A        public void swim() %7B%0A            OceanAnimal currentAnimal = (OceanAnimal) getCurrentAnimal();%0A            currentAnimal.swimming();%0A        %7D%0A%0A        private void swimming() %7B%0A            System.out.println(getCurrentAnimal().getClass().getSimpleName() + %22 is swimming%22);%0A        %7D%0A%0A        abstract Swimmable getCurrentAnimal();%0A    %7D%0A%0A    static class Orca extends OceanAnimal %7B%0A        @Override%0A        Swimmable getCurrentAnimal() %7B%0A            return this;%0A        %7D%0A    %7D%0A%0A    static class Whale extends OceanAnimal %7B%0A        @Override%0A        Swimmable getCurrentAnimal() %7B%0A            return this;%0A        %7D%0A    %7D%0A%0A    static class Otter implements Walkable, Swimmable %7B%0A        @Override%0A        public void swim() %7B%0A%0A        %7D%0A%0A        @Override%0A        public void walk() %7B%0A%0A        %7D%0A    %7D%0A%7D%0A

Complete task1416