code: public static VariableMap fromMap(Map<String, Object> map) {
      if(map instanceof VariableMap) {
        return (VariableMap) map;
      }
      else {
        return new VariableMapImpl(map);
      }
    }
docs: If the given map is not a variable map, adds all its entries as untyped
  values to a new {@link VariableMap}. If the given map is a {@link VariableMap},
  it is returned as is.