code: @SuppressWarnings("unchecked")
  	public static <V> Optional<V> extractValue(Expression expr, TypeInformation<V> type) {
  		if (expr instanceof ValueLiteralExpression) {
  			final ValueLiteralExpression valueLiteral = (ValueLiteralExpression) expr;
  			if (valueLiteral.getType().equals(type)) {
  				return Optional.of((V) valueLiteral.getValue());
  			}
  		}
  		return Optional.empty();
  	}
docs: Extracts value of given type from expression assuming it is a {@link ValueLiteralExpression}.
  
  @param expr literal to extract the value from
  @param type expected type to extract from the literal
  @param <V> type of extracted value
  @return extracted value or empty if could not extract value of given type