code: protected final void checkForLock() throws LockException, RepositoryException {
          Lock lock = getLockIfExists();
          if (lock != null && !lock.isLockOwningSession() && lock.getLockToken() == null) {
              throw new LockException(JcrI18n.lockTokenNotHeld.text(location()));
          }
      }
docs: Checks that this node is not already locked by another session. If the node is not locked or the node is locked but the
  lock is owned by this {@code Session}, this method completes silently. If the node is locked (either directly or as part of
  a deep lock from an ancestor), this method throws a {@code LockException}.
  
  @throws LockException if this node is locked (that is, if {@code isLocked() == true && getLock().getLockToken() == null}).
  @throws RepositoryException if any other error occurs
  @see Node#isLocked()
  @see Lock#getLockToken()