docs: protected static Object literalValue( StaticOperand staticOperand,
                                            QueryContext context,
                                            TypeFactory<?> type ) {
          // Determine the literal value ...
          Object literalValue = null;
          if (staticOperand instanceof BindVariableName) {
              BindVariableName bindVariable = (BindVariableName)staticOperand;
              String variableName = bindVariable.getBindVariableName();
              literalValue = context.getVariables().get(variableName); // may be null
              if (LOGGER.isTraceEnabled()) {
                  LOGGER.trace("Using variable '{0}' value: {1}", variableName, literalValue);
              }
              if (literalValue instanceof Collection || literalValue instanceof Object[]) return literalValue;
              return type.create(literalValue); // without converting!
          }
          if (staticOperand instanceof LiteralValue) {
              LiteralValue literal = (LiteralValue)staticOperand;
              Value value = literal.getLiteralValue();
              if (value != null) {
                  // Use the proper type factory to ensure the value is the correct type ...
                  PropertyType propType = PropertyTypeUtil.modePropertyTypeFor(value.getType());
                  try {
                      literalValue = context.getExecutionContext().getValueFactories().getValueFactory(propType)
                                            .create(value.getString());
                  } catch (RepositoryException e) {
                      // Really shouldn't happen, but just in case ...
                      throw new SystemFailureException(e);
                  }
              }
          } else if (staticOperand instanceof Literal) {
              Literal literal = (Literal)staticOperand;
              literalValue = literal.value();
          }
          return type != null ? type.create(literalValue) : null;
      }