Не понимаю почему вывод не такой как я ожидаю (проверку при дебаге он просто проходит мимо и создает два объекта мапа с одинаковыми ключами)
public class Solution1 {
public static void main(String[] args) throws IOException {
FileReader file = new FileReader(args[0]);
TreeMap<String, Double> list = new TreeMap<>();
Scanner sc = new Scanner(file);
while (sc.hasNext()) {
String str = sc.nextLine();
String[] s = str.split("\\s");
String name = s[0];
Double count = Double.parseDouble(s[1]);
list.put(name, count);
}
sc.close();
file.close();
list.forEach((a, b) -> System.out.println(a + " " + b));
}
}