Can you help me? Last condition not verifying..
package com.codegym.task.task10.task1019;
import java.io.*;
import java.util.HashMap;
import java.util.Map;
/*
Functionality is not enough!
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
HashMap<String, Integer> map = new HashMap<String, Integer>();
while(true){
Integer id = Integer.parseInt(reader.readLine());
String name = reader.readLine();
if (id == null)
break;
if (name.isEmpty()){
map.put("", id);
break;
}
map.put(name, id);
}
for(Map.Entry<String,Integer> entry : map.entrySet()){
System.out.println(entry.getValue()+" "+entry.getKey());
}
}
}