Skip to content

Tag: set

Java: join the values of a map containing sets

Consider the following pseudo Map<String, Set<String>>: What is the best way to join the value Sets into a single Set (above example should be [“A”, “B”, “C”, “D”]). The order of the resulting set does not matter. I know that I can to something like …