I'm not sure the exact page because i purchased through the Play Store. It says page 54-57/1351.
Given how pedantic this
test is, I don't think the following answer E for Question 3 is sufficient to be true in all cases.
Points to note:
1. This is a lambda with an expression without a body block. data.add(s) vs {data.add(s);}
These are not legal:
2. Assuming we do convert this lambda to one with a body we could add a sync block as follows:
2. This scenario can still fail if you don't use the same mutex reference object. Example as follows:
3. Another option would be to leverage the Collections.synchronizedCollection API.