/** * Counts the number of occurrencies of the argument's value in the objects of the given iterable * Actually it handles also Maps, Arrays and Iterator by collecting their values. * Note that this method accepts an Object in order to be used in conjunction with the {@link Lambda#forEach(Iterable)}. * @param iterable The iterable of objects' arguments to be counted * @param argument An argument defined using the {@link Lambda#on(Class)} method * @return A map having as values the number of occurrencies of the corresponding object's argument in the given iterable */ public static <A> Map<A, Integer> count(Object iterable, A argument) { return count(extract(iterable, argument)); }