Java provides an easy method in java.utils.Collections class to
create a ThreadSafe collection from a regular collection.
We can use the method synchronizedCollection() for this purpose.
For any class of type T we can use following method:
static
c)
https://www.javatpoint.com/java-collections-synchronizedcollection-method