I am using Map<String, Optional<List<String>>> . I get an obvious NullPointerException because this key is null .
Is there a way to deal with a zero situation?
public Map<MyEnum, Optional<List<String>>> process(Map<MyEnum, Optional<List<String>>> map) { Map<MyEnum, Optional<List<String>>> resultMap = new HashMap<>();
I am trying to avoid if-else checking for null using an option.
source share