@@ -0,0 +1,1573 @@
+package com.javarush.task.task08.task0820;%0A%0Aimport java.util.HashSet;%0Aimport java.util.Set;%0A%0A/* %0A%D0%9C%D0%BD%D0%BE%D0%B6%D0%B5%D1%81%D1%82%D0%B2%D0%BE %D0%B2%D1%81%D0%B5%D1%85 %D0%B6%D0%B8%D0%B2%D0%BE%D1%82%D0%BD%D1%8B%D1%85%0A*/%0A%0Apublic class Solution %7B%0A    public static void main(String%5B%5D args) %7B%0A        Set%3CCat%3E cats = createCats();%0A        Set%3CDog%3E dogs = createDogs();%0A%0A        Set%3CObject%3E pets = join(cats, dogs);%0A        printPets(pets);%0A%0A        removeCats(pets, cats);%0A        printPets(pets);%0A    %7D%0A%0A    public static Set%3CCat%3E createCats() %7B%0A        HashSet%3CCat%3E result = new HashSet%3CCat%3E();%0A%0A        //%D0%BD%D0%B0%D0%BF%D0%B8%D1%88%D0%B8%D1%82%D0%B5 %D1%82%D1%83%D1%82 %D0%B2%D0%B0%D1%88 %D0%BA%D0%BE%D0%B4%0A        result.add(new Cat());%0A        result.add(new Cat());%0A        result.add(new Cat());%0A        result.add(new Cat());%0A%0A        return result;%0A    %7D%0A%0A    public static Set%3CDog%3E createDogs() %7B%0A        //%D0%BD%D0%B0%D0%BF%D0%B8%D1%88%D0%B8%D1%82%D0%B5 %D1%82%D1%83%D1%82 %D0%B2%D0%B0%D1%88 %D0%BA%D0%BE%D0%B4%0A        HashSet%3CDog%3E result = new HashSet%3C%3E();%0A%0A        result.add(new Dog());%0A        result.add(new Dog());%0A        result.add(new Dog());%0A%0A        return result;%0A    %7D%0A%0A    public static Set%3CObject%3E join(Set%3CCat%3E cats, Set%3CDog%3E dogs) %7B%0A        //%D0%BD%D0%B0%D0%BF%D0%B8%D1%88%D0%B8%D1%82%D0%B5 %D1%82%D1%83%D1%82 %D0%B2%D0%B0%D1%88 %D0%BA%D0%BE%D0%B4%0A        HashSet%3CObject%3E pets = new HashSet%3C%3E();%0A%0A        pets.addAll(cats);%0A        pets.addAll(dogs);%0A%0A        return pets;%0A    %7D%0A%0A    public static void removeCats(Set%3CObject%3E pets, Set%3CCat%3E cats) %7B%0A        //%D0%BD%D0%B0%D0%BF%D0%B8%D1%88%D0%B8%D1%82%D0%B5 %D1%82%D1%83%D1%82 %D0%B2%D0%B0%D1%88 %D0%BA%D0%BE%D0%B4%0A        pets.removeAll(cats);%0A    %7D%0A%0A    public static void printPets(Set%3CObject%3E pets) %7B%0A        //%D0%BD%D0%B0%D0%BF%D0%B8%D1%88%D0%B8%D1%82%D0%B5 %D1%82%D1%83%D1%82 %D0%B2%D0%B0%D1%88 %D0%BA%D0%BE%D0%B4%0A        for (Object pet : pets) %7B%0A            System.out.println(pet);%0A        %7D%0A    %7D%0A%0A    //%D0%BD%D0%B0%D0%BF%D0%B8%D1%88%D0%B8%D1%82%D0%B5 %D1%82%D1%83%D1%82 %D0%B2%D0%B0%D1%88 %D0%BA%D0%BE%D0%B4%0A    public static class Cat %7B%0A%0A    %7D%0A%0A    public static class Dog %7B%0A%0A    %7D%0A%7D%0A

Complete task0820