docs: public final boolean lockIfMatches(final Filter filter, long lockID) throws SevereMessageStoreException
      {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.entry(this, tc, "lockIfMatches", new Object[] { filter, Long.valueOf(lockID) });
  
          boolean locked = false;
  
          boolean matches = false;
          AbstractItem item = getItem();
          if (null == item)
          {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                  SibTr.debug(this, tc, "item does not exist");
          }
          else
          {
              try
              {
                  if (null == filter || filter.filterMatches(item))
                  {
                      matches = true;
                  }
              } catch (Exception e)
              {
                  //No FFDC Code Needed.
                  // assume exception is false return
              }
          }
  
          boolean hasBecomeNonReleasable = false;
          if (matches)
          {
              synchronized (this)
              {
                  if (isAvailable() && !isExpired())
                  {
                      if (ItemLinkState.STATE_AVAILABLE == _itemLinkState)
                      {
                          ListStatistics stats = getParentStatistics();
                          synchronized (stats)
                          {
                              stats.incrementLocked();
                              stats.decrementAvailable();
                          }
                      }
                      else
                      {
                          if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                              SibTr.event(this, tc, "Invalid Item state: " + _itemLinkState);
                          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                              SibTr.exit(this, tc, "lockIfMatches");
                          throw new StateException(_itemLinkState.toString());
                      }
  
                      _lockID = lockID;
                      hasBecomeNonReleasable = _declareNotDiscardable(item);
                      _itemLinkState = ItemLinkState.STATE_LOCKED;
                      locked = true;
                  }
              }
              if (hasBecomeNonReleasable)
              {
                  _declareNotReleasable();
              }
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.exit(this, tc, "lockIfMatches", Boolean.valueOf(locked));
          return locked;
      }