Объясните, что не так
package com.javarush.task.task08.task0829;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
import java.util.Map;
/*
Модернизация ПО
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
Map<String, String> list = new HashMap<>();
while (true) {
String city = reader.readLine();
String family = reader.readLine();
if (city.isEmpty()) {
break;
}
list.put(city, family);
}
ArrayList<String> checkCity = new ArrayList<>();
while(true){
String text = reader.readLine();
if (!text.isEmpty()){
checkCity.add(0,text);
break;
}
}
for (Map.Entry<String, String> mapAcess : list.entrySet()){
if (mapAcess.getKey().equals(checkCity.get(0)))
System.out.println(mapAcess.getValue());
}
}
}