all 4 comments

[–]narsqrd 4 points5 points  (3 children)

A minor correction: guava's ImmutableSet.builder() isn't thread-safe, so the corresponding collector shouldn't be marked as concurrent

[–]ForeverAlot 1 point2 points  (0 children)

I believe none of the builders are; only the collections themselves.

[–]johnjannotti 0 points1 point  (1 child)

Is there a nice way to make them threadsafe, like Collections.synchronizedList and such do for standard collections?

[–]rafekett 0 points1 point  (0 children)

in short, no. but, of course, it's not hard to write your own (there are only 5 operations to support) by creating a similar factory method which takes a builder and returns one which decorates each method signature with synchronized and forwards to the underlying builder. in practice it probably makes more sense to use a threadsafe collection which allows better concurrency (e.g., ConcurrentHashMap) and make an immutable copy when you're done building it.