Same as
#expand(String,java.util.Map) but preserve an expansion template if the corresponding variable
is not defined in the
nameValuePairs map (i.e. map.contains(var)==false).
Meaning that a template may be returned.
If a default value exists for the undefined value, it will be used to replace the expansion pattern.
Beware that this behavior deviates from the URI Template specification.
For instance:
Given the following template variable names and values:
The following expansion templates will be expanded as shown if
preserveUndefinedVar is true:
http://example.com/{bar}
http://example.com/java
{foo=a_default_value}
a_default_value
http://example.com/{bar}/{foo}
http://example.com/java/{foo}