I've seen a class do something like this
class Foo {
private final Set<Bar> set = Collections.synchronizedSet(new HashSet<>));
public void add(Bar b) {
set.add(b);
}
}
However, the final set is not initialized in the constructor. Is it still visible to other threads?