Java streams

Flat mapping

Nested maps

import java.util.Map;
import java.util.HashMap;

public static void main(String[] args) {
    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);
    System.out.println(contextVariables);
}
{Loan={Installment=100, Duration=15}, Client={Salary=1950, Existing payments=100, Age=43}}