code: public static void assertNodeExistById(final Session session, final String itemId) throws RepositoryException {
          try {
              session.getNodeByIdentifier(itemId);
          } catch (final ItemNotFoundException e) {
              LOG.debug("Item with id {} does not exist", itemId, e);
              fail(e.getMessage());
          }
      }
docs: Asserts that an item, identified by it's unique id, is found in the repository session.
  
  @param session
  the session to be searched
  @param itemId
  the item expected to be found
  @throws RepositoryException