Is it possible (in simple way) to change it into java8 Stream? (Please do not comment/answer if you want to tell me that two for are better and not all loops should be changed to streams, it's not a point)
final Map<String, String> map = new HashMap<>();
for(final Person person: list) {
for(final Internal internal: person.getInternals()) {
final String key = person.getName() + internal.getKey();
map.put(key, internal.getValue());
}
}
The main problem is that I can't use flatMap because I will lose previous information. Each created key is unique.