I have a class like this:
public class A {
private List<String> stringList;
private String someString;
}
I have a list of these objects like so:
List<A> list = //some method to generate list
I want to conver this to a Map<String, String>
where each string in the stringList
maps to the same someString
value (like a multimap). How can I do this using java 8 stream?
I could convert this to a flat map like so:
list.stream.flatMap(....
But I'm not sure where to go from there.