List<String> newList = new ArrayList<String>(); newList.addAll(neighb); data.put(words.get(i), newList); newList.clear();