Java streams

Flat mapping

Nested maps

final Map<String, Object> client = new HashMap<>();
client.put("Age", 43);
client.put("Salary", 1950);
client.put("Existing payments", 100);
final Map<String, Object> loan = new HashMap<>();
loan.put("Duration", 15);
loan.put("Installment", 100);
final Map<String, Object> contextVariables = new HashMap<>();
contextVariables.put("Client", client);
contextVariables.put("Loan", loan);

|   contextVariables.entrySet().stream().flatMap(e -> e.getValue())

incompatible types: cannot infer type-variable(s) R

    (argument mismatch; bad return type in lambda expression

      java.lang.Object cannot be converted to java.util.stream.Stream<? extends R>)