code: public Element removeByKey(Object key, boolean dropRef)
      {
          int i = findIndexByKey(key);
          Element element = null;
  
          // Check if the object is in the cache
          if (i != -1)
          {
              element = (Element) get(i);
  
              // Objects must either be unpinned, or pinned only once
              // (presumably by the caller)
              if ((!dropRef && element.pinned > 0) ||
                  (dropRef && element.pinned > 1)) {
                  throw new IllegalOperationException(key, element.pinned);
              }
  
              remove(i);
          }
  
          return element;
      }
docs: Remove the object associated with the specified key from the bucket.
  Returns the Element holding the removed object. Optionally drops
  a reference on the object before removing it
  
  @param key key of the object element to be removed.
  @param dropRef true indicates a reference should be dropped
  @return the Element holding the removed object.