base/common/src/main/com/thesett/common/util/AbstractHeap.java
public boolean remove(Object o)
    {
        Iterator<E> e = iterator();

        if (o == null)
        {
            while (e.hasNext())
            {
                if (e.next() == null)
                {
                    e.remove();

                    return true;
                }
            }
        }
        else
        {
            while (e.hasNext())
            {
                if (o.equals(e.next()))
                {
                    e.remove();

                    return true;
                }
            }
        }

        return false;
    }
public boolean remove(Object o)
    {
        Iterator<E> e = iterator();

        if (o == null)
        {
            while (e.hasNext())
            {
                if (e.next() == null)
                {
                    e.remove();

                    return true;
                }
            }
        }
        else
        {
            while (e.hasNext())
            {
                if (o.equals(e.next()))
                {
                    e.remove();

                    return true;
                }
            }
        }

        return false;
    }
public boolean remove ( Object o ) { Iterator < E > e = iterator ( ) ; if ( o == null ) { while ( e . hasNext ( ) ) { if ( e . next ( ) == null ) { e . remove ( ) ; return true ; } } } else { while ( e . hasNext ( ) ) { if ( o . equals ( e . next ( ) ) ) { e . remove ( ) ; return true ; } } } return false ; }
Removes a single instance of the specified element from this heap, if it is present. (optional operation). More
formally, removes an element <tt>e</tt> such that <tt>(o==null ? e==null : o.equals(e))</tt>, if the collection
contains one or more such elements. Returns <tt>true</tt> if the collection contained the specified element (or
equivalently, if the collection changed as a result of the call).

<p>This implementation iterates over the collection looking for the specified element. If it finds the element,
it removes the element from the collection using the iterator's remove method.

<p>Note that this implementation throws an <tt>UnsupportedOperationException</tt> if the iterator returned by
this collection's iterator method does not implement the <tt>remove</tt> method and this collection contains the
specified object.

@param  o element to be removed from this collection, if present.

@return <tt>true</tt> if the collection contained the specified element.

@throws UnsupportedOperationException if the <tt>remove</tt> method is not supported by this collection.
Removes a single instance of the specified element from this heap if it is present . ( optional operation ) . More formally removes an element <tt > e< / tt > such that <tt > ( o == null ? e == null : o . equals ( e )) < / tt > if the collection contains one or more such elements . Returns <tt > true< / tt > if the collection contained the specified element ( or equivalently if the collection changed as a result of the call ) .