### Question:
UserConvert { public HashMap<Integer, User> process(List<User> list) { HashMap<Integer, User> result = new HashMap<>(); for (User element : list) { result.put(element.getId(), element); } return result; }  HashMap<Integer, User> process(List<User> list);  }### Answer:
@Test public void usersListConvertToHashMap() { List<User> userList = new ArrayList<>(); userList.add(new User(3, "Ivan", "Spb")); userList.add(new User(4, "Vasiliy", "Turinsk")); UserConvert convertTest = new UserConvert(); HashMap<Integer, User> result = convertTest.process(userList); assertThat(result.get(3).getName(), is("Ivan")); }