public boolean remove(T element) {
    Node<T> prev = null;
    Node<T> node = head;
    while (node != null && node.value != element) {
      prev = node;
      node = node.next;
    }

    if (node == null) {
      return false;
    }

    if (node.next != null) {
      node.next.delay += node.delay;
    }

    if (prev == null) {
      head = node.next;
    } else {
      prev.next = node.next;
    }
    size--;
    return true;
  }
Removes the specified element from the queue.

@param element the element to remove
@return whether the element was removed
imagepipeline-base-test/src/main/java/com/facebook/imagepipeline/testing/DeltaQueue.java