title: java - how to flatten a collection of sets, and should I do it in the first place?
body: <p>say i have a graph, implemented with two maps (in and out) that map (source, set(edge)) and (target, set(edge)), respectively. until now, i also had allEdges set, which i decided to get rid of. returning edge set is now more difficult, as i have to flatten out the values of one of the maps. what's the best (fastest) way to do it? or should i just leave the allEdges set (i don't care much about memory, just thought having it was a bit redundant).</p>
  
  <p>thanks</p>