В чем ошибка?
package com.javarush.task.task09.task0927;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.io.map;
/*
Десять котов
*/
public class Solution
{
public static void main(String[] args)
{
Map map = createMap();
Set set = convertMapToSet(map);
printCatSet(set);
}
public static Map createMap()
{
String cat;
for (int i=0; i <10; i++)
{
cat = "Tom" +i;
map.put(cat, new Cat(cat));
}
return map;
}
public static Set convertMapToSet(Map map)
{
Set set = new HashSet();
set.addAll(map.values());
return set;
}
public static void printCatSet(Set set)
{
for (Cat cat:set)
{
System.out.println(cat);
}
}
public static class Cat
{
private String name;
public Cat(String name)
{
this.name = name;
}
public String toString()
{
return "Cat "+this.name;
}
}
}
class Cat {
private String name;
public Cat(String name) {
this.name = name;
}
public String toString() {
return "Cat " + this.name;
}
}