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
344105
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;
    }
805968
private boolean containsElements(final Collection<?> coll) {
        if (coll == null || coll.isEmpty()) {
            return false;
        }
        for (final Object name : coll) {
            if (name != null) {
                return true;
            }
        }
        return false;
    }
1249017
public static Map<?, ?> convertToMap(Collection<?> coll, String keyProperty) {
    Map<Object, Object> map = newHashMap();
    for (Object obj : coll) {
      Object key = null;
      try {
        key = PropertyUtils.getProperty(obj, keyProperty);
      } catch (Exception e) {
        Throwables.propagate(e);
      }
      map.put(key, obj);
    }
    return map;
  }
677009
public static <T> List<List<T>> divideAsList(List<T> coll) {
		List<List<T>> result = new ArrayList<>();
		for (T t : coll) {
			List<T> list = new ArrayList<>();
			list.add(t);
			result.add(list);
		}
		return result;
	}
914350
public static <T> List<T> sortedCollection(Collection<T> coll) {
	List<T> list = new LinkedList<T>(coll);
	Collections.sort(list, new UComp<T>());
	return list;
    }
926878
@SafeVarargs
	public static <T> Collection<T> union(Collection<T> coll1, Collection<T> coll2, Collection<T>... otherColls) {
		Collection<T> union = union(coll1, coll2);
		for (Collection<T> coll : otherColls) {
			union = union(union, coll);
		}
		return union;
	}
134874
public List<MapKeyJoinColumn<ElementCollection<T>>> getAllMapKeyJoinColumn()
   {
      List<MapKeyJoinColumn<ElementCollection<T>>> list = new ArrayList<MapKeyJoinColumn<ElementCollection<T>>>();
      List<Node> nodeList = childNode.get("map-key-join-column");
      for(Node node: nodeList)
      {
         MapKeyJoinColumn<ElementCollection<T>>  type = new MapKeyJoinColumnImpl<ElementCollection<T>>(this, "map-key-join-column", childNode, node);
         list.add(type);
      }
      return list;
   }
46218
public boolean addAll(Collection<T> coll) {
	boolean newData = false;
	for(T elem : coll) {
	    if(set.add(elem)) {
		newData = true;
	    }
	}
	return newData;
    }
1126230
public static <A> CollQuery<A> from(A alias, Iterable<A> col) {
        Path<A> expr = Alias.$(alias);
        return new CollQuery<Void>().from(expr, col).select(expr);
    }
84335
@SuppressWarnings("unchecked")
	public static <T> T[] toArray(Collection<T> col, Class<T> type) {
		return col.toArray((T[]) Array.newInstance(type, 0));
	}
991081
def containerize(coll):
  
  if isinstance(coll, Container):
    [setattr(coll, k, containerize(v)) for (k, v) in coll.items()]
    return coll
  elif isinstance(coll, dict):
    return containerize(Container(**coll))
  elif isinstance(coll, list):
    for j, i in enumerate(coll):
      if isinstance(i, dict):
        coll[j] = containerize(Container(**i))
    return coll
  else:
    return coll
399023
public static Collection map(Mapper mapper, Collection c, boolean allowNull) {
        return map(mapper, c.iterator(), allowNull);
    }
723787
public static Cardinality createCardinality(AtlasCardinality cardinality) {
        switch(cardinality) {

        case SINGLE:
            return Cardinality.SINGLE;
        case LIST:
            return Cardinality.LIST;
        case SET:
            return Cardinality.SET;
        default:
            throw new IllegalStateException("Unrecognized cardinality: " + cardinality);
        }
    }
221820
private static int maxLength(List<String> coll) {
		int max = 0;
		for (String e : coll) {
			int length = e.length();
			if (length > max) {
				max = length;
			}
		}
		return max;
	}
169279
static <T> Iterable<T> prepend(Collection<T> coll, Iterable<T> rest) {
        return (coll.size() == 0) ? rest : new CompoundIterable<T>(coll, rest);
    }
348201
public static <T extends Comparable<?>> List<T> topN(Iterable<T> coll, int n) {
		return Ordering.natural().greatestOf(coll, n);
	}
1149892
public static <T> Function<Object, Collection<T>> COLLECTION(final Class<? extends Collection> collectionType, final Class<T> componentType) {
      return new CollectionConverterImpl<>(collectionType, componentType);
   }