around this issue Note that Optional can't contain null values, so your code will either execute the conditional, or fail with an exception at get(). You could change the get() to orElse(null); but you'd still need the separate conditional.
String name =
.map(m -> m.getData().get("name"))
Use java.util.Optional to return null for subfield of Optional type