### Question:
PlayerGamesView { public Map<String, List<String>> getGroupsMap() { Map<String, List<String>> result = new LinkedHashMap<>(); for (List<String> group : getGroupsByField()) { for (String player : group) { if (result.containsKey(player)) { continue; } result.put(player, group); } } return result; }  Map<String, GameData> getGamesDataMap(); Map<String, List<String>> getGroupsMap(); List<List<String>> getGroupsByRooms(); List<List<String>> getGroupsByField(); Map<String, Object> getScores(); List<PScoresOf> getScoresForGame(String gameName); List<PScoresOf> getScoresForRoom(String roomName); Map<String, String> getReadableNames();  }### Answer:
@Test public void testGetGroupsMap_usersInSameGroup() { givenUsersInSameGroup(); Map<String, List<String>> map = playerGamesView.getGroupsMap(); assertEquals("{user1=[user1, user2, user3, user4], " + "user2=[user1, user2, user3, user4], " + "user3=[user1, user2, user3, user4], " + "user4=[user1, user2, user3, user4]}", sortKeys(map).toString()); }
@Test public void testGetGroupsMap_usersInSeveralGroups() { givenUsersInSeveralGroups_inOneGeneralGameRoom(); Map<String, List<String>> map = playerGamesView.getGroupsMap(); assertEquals("{user1=[user1, user2], " + "user2=[user1, user2], " + "user3=[user3, user4], " + "user4=[user3, user4]}", sortKeys(map).toString()); }