ЧТО НЕ ТАК
package com.javarush.task.task08.task0821;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
/*
Однофамильцы и тёзки
*/
public class Solution {
public static void main(String[] args) throws IOException {
Map<String, String> map = createPeopleMap();
printPeopleMap(map);
}
public static Map<String, String> createPeopleMap() throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
Map<String,String> map2 = new HashMap<String, String>();
for (int i = 0; i < 10; i++) {
String key = reader.readLine();
String value = reader.readLine();
map2.put(key,value);
}
return map2;
}
public static void printPeopleMap(Map<String, String> map) {
for (Map.Entry<String, String> s : map.entrySet()) {
System.out.println(s.getKey() + " " + s.getValue());
}
}
}