public static <T> boolean addRemove(final Collection<T> coll, final T item, final boolean remove) {
        if (remove) {
            return coll.remove(item);
        }
        return coll.add(item);
    }
Helper method to quickly add OR remove an item from/to a collection programatically
If parameter 'remove' is true then item is removed; otherwise it is added
main/src/main/java/cgeo/geocaching/utils/CommonUtils.java