public boolean remove(final T bagEntry)
   {
      if (!bagEntry.compareAndSet(STATE_IN_USE, STATE_REMOVED) && !bagEntry.compareAndSet(STATE_RESERVED, STATE_REMOVED) && !closed) {
         LOGGER.warn("Attempt to remove an object from the bag that was not borrowed or reserved: {}", bagEntry);
         return false;
      }

      final boolean removed = sharedList.remove(bagEntry);
      if (!removed && !closed) {
         LOGGER.warn("Attempt to remove an object from the bag that does not exist: {}", bagEntry);
      }

      return removed;
   }
public boolean remove ( final T bagEntry ) { if ( ! bagEntry . compareAndSet ( STATE_IN_USE , STATE_REMOVED ) && ! bagEntry . compareAndSet ( STATE_RESERVED , STATE_REMOVED ) && ! closed ) { LOGGER . warn ( "Attempt to remove an object from the bag that was not borrowed or reserved: {}" , bagEntry ) ; return false ; } final boolean removed = sharedList . remove ( bagEntry ) ; if ( ! removed && ! closed ) { LOGGER . warn ( "Attempt to remove an object from the bag that does not exist: {}" , bagEntry ) ; } return removed ; }
Remove a value from the bag.  This method should only be called
with objects obtained by <code>borrow(long, TimeUnit)</code> or <code>reserve(T)</code>

@param bagEntry the value to remove
@return true if the entry was removed, false otherwise
@throws IllegalStateException if an attempt is made to remove an object
from the bag that was not borrowed or reserved first