guava HashMultimap Demo
guava-libraries http://code.google.com/p/guava-libraries/
public class MultiMapDemo { public static void main(String[] args) { HashMultimap<String, String> map = HashMultimap.create(); map.put("a", "AAAAA"); map.put("a", "AAA"); map.put("a", "AA"); map.put("b", "BBBBBB"); map.put("b", "BBBB"); Set<String> values = map.get("a"); for (String value : values) { System.out.println(value); } System.out.println("-----------------------"); Set<String> keys = map.keySet(); for (String key : keys) { System.out.println(key); } } }