Why in this getInstance synchronized to do?
This is a singleton class for working with the network using retrofit.
public static NetworkWorker getInstance(){ if (networkWorker == null){ synchronized (NetworkWorker.class) { if (networkWorker == null) { networkWorker = new NetworkWorker(); } } } return networkWorker; }