class CollectionUtilities {

    public static <T> T removeFirst(Iterable<? extends T> iterable, Predicate<? super T> predicate)
    {
        for (Iterator<? extends T> iter = iterable.iterator(); iter.hasNext();)
        {
            T elem = iter.next();
            if (predicate.test(elem))
            {
                iter.remove();
                return elem;
            }
        }
        return null;
    }

    private  CollectionUtilities();

}