I am trying to convert a properties object into a HashMap<String, String>. I am able to convert it to a Map, but not able to do it diectly to a HashMap.
So far, I have done this:
dbProperties.entrySet().stream().collect(Collectors.toMap(k -> k.getKey().toString(), v -> v.getValue().toString()));
This gives me a Map<Object, Object>. Is there way to get it to a HashMap<String, String> without casting or anything?