I have a function definition which takes Optional> as a parameter.
To call the function I create:
Optional<Map<String, String>> options = Optional.ofNullable(config.getMap(
OPTIONS, String.class, String.class));
myfunc(ImmutableMap.copyOf(options));
However I get an error: The method copyOf(Map<? extends K,? extends V>) in the type ImmutableMap is not applicable for the arguments (Optional<Map<String,String>>)
Is there a way to allow copyOf to use Optional map ?