This task should be so easy so why HashMap is not correct? Why also if I call 2 methods in main class something is wrong?