code: public static <T> Map<T, Integer> getCardinalityMap(final Collection<T> coll) {
          Map count = new HashMap<T, Integer>();
          for (T item : coll) {
              Integer c = (Integer) (count.get(item));
              if (c == null) {
                  count.put(item, INTEGER_ONE);
              } else {
                  count.put(item, new Integer(c.intValue() + 1));
              }
          }
          return count;
      }
docs: Creates a cardinality map from {@code coll}.
  
  @param coll the collection of items to convert
  @param <T>  the type of elements in the input collection
  @return the cardinality map