code: public static <K, E> Map<K, Integer> countBy(final Iterable<E> iterable, Function<E, K> func) {
          final Map<K, Integer> retVal = newLinkedHashMap();
          for (E e : iterable) {
              final K key = func.apply(e);
              if (retVal.containsKey(key)) {
                  retVal.put(key, 1 + retVal.get(key));
              } else {
                  retVal.put(key, 1);
              }
          }
          return retVal;
      }
docs: /*
  Documented, #countBy