code: private void checkTempBlockOwnedBySession(long sessionId, long blockId)
        throws BlockDoesNotExistException, BlockAlreadyExistsException, InvalidWorkerStateException {
      if (mMetaManager.hasBlockMeta(blockId)) {
        throw new BlockAlreadyExistsException(ExceptionMessage.TEMP_BLOCK_ID_COMMITTED, blockId);
      }
      TempBlockMeta tempBlockMeta = mMetaManager.getTempBlockMeta(blockId);
      long ownerSessionId = tempBlockMeta.getSessionId();
      if (ownerSessionId != sessionId) {
        throw new InvalidWorkerStateException(ExceptionMessage.BLOCK_ID_FOR_DIFFERENT_SESSION,
            blockId, ownerSessionId, sessionId);
      }
    }
docs: Checks if block id is a temporary block and owned by session id. This method must be enclosed
  by {@link #mMetadataLock}.
  
  @param sessionId the id of session
  @param blockId the id of block
  @throws BlockDoesNotExistException if block id can not be found in temporary blocks
  @throws BlockAlreadyExistsException if block id already exists in committed blocks
  @throws InvalidWorkerStateException if block id is not owned by session id