public static Map<String,Integer> count( List items ) {
if (items == null || items.size() == 0) {
return null;
}
Map<String, Integer> map = new HashMap<String, Integer>();
for (String temp : items) {
Integer count = map.get(temp);
map.put(temp, (count == null) ? 1 : count + 1);
}
return map;
}