code: public static void assertNodeNotExistById(final Session session, final String itemId) throws RepositoryException {
          try {
              session.getNodeByIdentifier(itemId);
              fail("ItemNotFoundException expected");
          } catch (final ItemNotFoundException e) { // NOSONAR
              // this was expected
          }
      }
docs: Asserts that an item, identified by it's unique id, is not found in the repository session.
  
  @param session
  the session to be searched
  @param itemId
  the item expected not to be found
  @throws RepositoryException