Yes, that's a simple adapter: http://docs.oracle.com/javase/7/docs/api/java/util/Collections.html#newSetFromMap(java.util.Map)
See the example there. -Aleksey. On 09/29/2014 10:10 PM, Marcus Lagergren wrote: > Aleksey - I still need the weak semantics, because I don’t want to hold on to > the strings. Would that work for the WeakHashMap and preserve semantics? > #iamnotajavaprogrammer. > >> >> The entire shenanigan would go away if you turn the Map into Set with >> Collections.newSetFromMap(...), and then do add(). >> >> -Aleksey. >> >> >
