SetValuedMap<String,String> setValuedMap = new HashSetValuedHashMap(); setValuedMap.put("United States", "Washington"); setValuedMap.put("Canada", "Ottawa"); setValuedMap.put("Canada", "Ottawa"); setValuedMap.put("South Africa", "Pretoria"); setValuedMap.put("South Africa", "Cape Town"); setValuedMap.put("South Africa", "Bloemfontein"); System.out.println(setValuedMap); // Values being added to the Set and hence doesn't allow duplicates