private void assertTagValue(JsonObject node, String propertyName, String value)
      throws XPathExpressionException {

    List<JsonElement> list = new ArrayList<>();

    if (propertyName.startsWith("/")) {
      findJsonElementsPath(node, propertyName.substring(1).split("/"), list);
    } else {
      findJsonElementsProp(node, propertyName, list);
    }

    if (list.isEmpty()) {
      fail("Property '" + propertyName + "' no found in the document");

    } else {

      for (JsonElement elem : list) {

        if (elem instanceof JsonPrimitive) {

          if (value.equals(((JsonPrimitive) elem).getAsString())) {
            return;
          }

        } else if (elem instanceof JsonArray) {

          JsonArray elemArray = (JsonArray) elem;
          for (JsonElement arrayElem : elemArray) {

            if (arrayElem instanceof JsonPrimitive) {

              if (value.equals(((JsonPrimitive) arrayElem).getAsString())) {
                return;
              }
            }
          }
        }
      }

      fail("There is no tag '" + propertyName + "' with value '" + value + "'");
    }
  }