@@ -0,0 +1,1444 @@
+package org.cyclops.cyclopscore.helper;%0A%0Aimport com.google.common.collect.Lists;%0Aimport com.google.common.collect.Sets;%0A%0Aimport java.util.List;%0Aimport java.util.Map;%0Aimport java.util.Set;%0A%0A/**%0A * Helper methods for collections.%0A * @author rubensworks%0A */%0Apublic final class CollectionHelpers %7B%0A%0A    /**%0A     * Add the given key value pair in a map structure where multiple values for a key can exist.%0A     * This will take care of making a new list into the map when one did not exist before.%0A     * @param map The map.%0A     * @param key The key.%0A     * @param value The value.%0A     * @param %3CK%3E The key type.%0A     * @param %3CV%3E The value type.%0A     */%0A    public static %3CK, V%3E void addToMapList(Map%3CK, List%3CV%3E%3E map, K key, V value) %7B%0A        if(!map.containsKey(key)) %7B%0A            map.put(key, Lists.%3CV%3EnewLinkedList());%0A        %7D%0A        map.get(key).add(value);%0A    %7D%0A%0A    /**%0A     * Add the given key value pair in a map structure where multiple values for a key can exist.%0A     * This will take care of making a new set into the map when one did not exist before.%0A     * @param map The map.%0A     * @param key The key.%0A     * @param value The value.%0A     * @param %3CK%3E The key type.%0A     * @param %3CV%3E The value type.%0A     */%0A    public static %3CK, V%3E void addToMapSet(Map%3CK, Set%3CV%3E%3E map, K key, V value) %7B%0A        if(!map.containsKey(key)) %7B%0A            map.put(key, Sets.%3CV%3EnewHashSet());%0A        %7D%0A        map.get(key).add(value);%0A    %7D%0A%0A%7D%0A

Add collection helper methods Adds convenience methods for insertion into Map<?, List<?>> and Map<?, Set<?>>.