@@ -0,0 +1,1516 @@
+package eu.mikroskeem.shuriken.common.collections;%0A%0Aimport org.jetbrains.annotations.NotNull;%0Aimport org.jetbrains.annotations.Nullable;%0A%0Aimport java.util.Iterator;%0Aimport java.util.List;%0Aimport java.util.Set;%0A%0A/**%0A * Collection utilities%0A *%0A * @author Mark Vainomaa%0A */%0Apublic final class CollectionUtilities %7B%0A    /**%0A     * Gets first item from iterator%0A     *%0A     * @param iterator Iterator%0A     * @param %3CT%3E Iterable type%0A     * @return First or null%0A     */%0A    @Nullable%0A    public static %3CT%3E T firstOrNull(@NotNull Iterator%3CT%3E iterator) %7B%0A        return iterator.hasNext() ? iterator.next() : null;%0A    %7D%0A%0A    /**%0A     * Gets first item from iterable, using %7B@link CollectionUtilities#firstOrNull(Iterator)%7D%0A     *%0A     * @param iterable Iterable%0A     * @param %3CT%3E Iterable type%0A     * @return First or null%0A     */%0A    @Nullable%0A    public static %3CT%3E T firstOrNull(@NotNull Iterable%3CT%3E iterable) %7B%0A        return firstOrNull(iterable.iterator());%0A    %7D%0A%0A    /**%0A     * Gets first item from list%0A     *%0A     * @param list List%0A     * @param %3CT%3E List type%0A     * @return First or null%0A     */%0A    @Nullable%0A    public static %3CT%3E T firstOrNull(@NotNull List%3CT%3E list) %7B%0A        return list.isEmpty() ? null : list.get(0);%0A    %7D%0A%0A    /**%0A     * Gets first item from set%0A     *%0A     * @param set Set%0A     * @param %3CT%3E Set type%0A     * @return First or null%0A     */%0A    @Nullable%0A    public static %3CT%3E T firstOrNull(@NotNull Set%3CT%3E set) %7B%0A        return set.isEmpty() ? null : firstOrNull(set.iterator());%0A    %7D%0A%7D%0A

Add collection utilities